在主目录中安装 Git - CentOS 5 - 无需 root

发布于 2024-08-28 16:07:16 字数 953 浏览 8 评论 0原文

在工作中,开发没有版本控制。我的意思是,只有当变更集准备好进行回归测试时,我们才被允许签入 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

情徒 2024-09-04 16:07:16

Chris Kaminski 已经链接到 git 站点(尽管真实的 url 是 http://git-scm.com/)。那里有一个 tarball 的下载链接。您还可以克隆 git.git 存储库:

 git clone git://git.kernel.org/pub/scm/git/git.git

 git clone http://www.kernel.org/pub/scm/git/git.git   # if behind a firewall

无论哪种方式,您所要做的就是 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:

 git clone git://git.kernel.org/pub/scm/git/git.git

 git clone http://www.kernel.org/pub/scm/git/git.git   # if behind a firewall

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.

一个人的旅程 2024-09-04 16:07:16

www.git-scm.org

或者您可以自己下载 RPM,然后像这样提取它们

rpm2cpio git-1.7.0.5.i386.rpm |cpio -iv 

:将其复制到 ~username/bin/git 并从那里运行它。

www.git-scm.org

Or you could download the RPMs yourself, and extract them like so:

rpm2cpio git-1.7.0.5.i386.rpm |cpio -iv 

and copy it into ~username/bin/git and run it from there.

长发绾君心 2024-09-04 16:07:16

这可能是一个显而易见的问题,但是......“你不能让你的系统管理员安装 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文