在主目录中安装 Git - CentOS 5 - 无需 root
在工作中,开发没有版本控制。我的意思是,只有当变更集准备好进行回归测试时,我们才被允许签入 P4 仓库。我们无法检查肝间的变化!开发过程中没有版本控制会带来很多问题,我不需要在这里讨论。相反,我将问题提交给 prodsys,他们说:“不,但你在主目录中所做的事情是你的事”。基本上,如果我想要的话,我可以自己安装。
不幸的是,我无法自己安装它,因为我工作时使用的是 CentOS 5,而且没有 root。如果你没有 root,百胜不会给你一天中的时间。那么我该怎么做才能获得 git 呢?我很喜欢静态链接的二进制文件,如果这很容易的话,但我在任何地方都找不到这样的东西。我也在寻找 git-p4。
编辑:我已经下载了 tarball,但我想我缺少 deps。我已阅读安装文档并选择退出每个可选依赖项:
make prefix=$HOME/git NO_TCLTK=YesPlease NO_OPENSSL=YesPlease NO_CURL=YesPlease NO_EXPAT=YesPlease
但我仍然无法构建。
我收到此错误:
: command not foundline 2:
: command not foundline 5:
: command not foundline 8:
./GIT-VERSION-GEN: line 14: syntax error near unexpected token `elif'
'/GIT-VERSION-GEN: line 14: `elif test -d .git -o -f .git &&
并且它构建了很多 .o,直到我到达:
...
LINK git-daemon
make: *** No rule to make target `GIT-VERSION-FILE', needed by `git-am'. Stop.`
并且我再次陷入困境。
At work, development doesn't have revision control. By this I mean that we are only allowed to check into the P4 depot when the change set is ready for regression testing. We can't check in intercolary changes! There are a host of problems with having no revision control during development that I don't need to go into here. Instead, I brought the problem to prodsys and they said, "no, but what you do in your home directory is your business". Basically, I can install it myself if I want it.
Unfortunately, I can't install it myself, because I'm on CentOS 5 at work and I don't have root. Yum won't give you the time of day if you don't have root. So what can I do to get git? I'm fine with statically linked binary if that makes it easy, but I can't find such a thing anywhere. I'm also looking for git-p4.
Edit: I've downloaded the tarball but I think I'm missing deps. I've read through the INSTALL doc and opted out of every optional dependency:
make prefix=$HOME/git NO_TCLTK=YesPlease NO_OPENSSL=YesPlease NO_CURL=YesPlease NO_EXPAT=YesPlease
But I still can't build.
I get this error:
: command not foundline 2:
: command not foundline 5:
: command not foundline 8:
./GIT-VERSION-GEN: line 14: syntax error near unexpected token `elif'
'/GIT-VERSION-GEN: line 14: `elif test -d .git -o -f .git &&
and it builds a lot of .o's until I get to:
...
LINK git-daemon
make: *** No rule to make target `GIT-VERSION-FILE', needed by `git-am'. Stop.`
And I'm stuck again.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Chris Kaminski 已经链接到 git 站点(尽管真实的 url 是 http://git-scm.com/)。那里有一个 tarball 的下载链接。您还可以克隆 git.git 存储库:
无论哪种方式,您所要做的就是
make install
- 默认前缀是 $HOME,将文件放置在 $HOME/bin、$HOME/libexec 中, 等等。如果你想保持它的分区(一个好主意,因为没有卸载规则),只需使用前缀选项,例如make prefix=$HOME/git
。Chris Kaminski already linked to the git site (though the true url is http://git-scm.com/). There's a download link for a tarball there. You can also clone the git.git repo:
Either way, all you'll have to do is
make install
- the default prefix is $HOME, placing files in $HOME/bin, $HOME/libexec, and so on. If you want to keep it partitioned (a good idea, since there's no uninstall rule), just use the prefix option, e.g.make prefix=$HOME/git
.www.git-scm.org
或者您可以自己下载 RPM,然后像这样提取它们
:将其复制到 ~username/bin/git 并从那里运行它。
www.git-scm.org
Or you could download the RPMs yourself, and extract them like so:
and copy it into ~username/bin/git and run it from there.
这可能是一个显而易见的问题,但是......“你不能让你的系统管理员安装 git 吗”?
通常,系统管理员会更乐意这样做,而不是让你用 make 安装它,因为至少这样他会意识到悬而未决的安全勘误表等(尤其是像 git 这样通过网络进行通信的东西)。
This is probably an obvious question but... "Can't you just ask your sysadmin to install git"?
Often the sysadmin will be happier to do that than have you install it with make, because at least then he'll be aware of pending security errata etc. (esp. so for something like git which speaks over the network).