我听说过关于 git 的好消息,我想在安装之前尝试一下。如果我想在学校使用 git,把它放在闪存驱动器上也很棒。是否可以使用完整路径/path/to/git init
?
我主要使用 Mac OS X,所以这个问题主要针对 Mac,但我也想知道它是否也可以在其他操作系统上使用。
编辑:
从源代码编译。我使用了以下命令:
cd git-1.7.5.1 #this is the decompressed dir containing src
make configure
./configure --prefix=/path/to/install/git
make all
sudo make install
这种方法的缺点是,一旦编译,目录就有 200MB 大。这就是为什么我选择 jgit 作为答案。jgit.sh
小于2MB,支持以下命令:
add Add file contents to the index
branch List, create, or delete branches
checkout Checkout a branch to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
daemon Export repositories over git://
diff Show diffs
fetch Update remote refs from another repository
init Create an empty git repository
log View commit history
merge Merges two development histories
push Update remote repository from local refs
rm Stop tracking a file
tag Create a tag
version Display the version of jgit
你可以jgit.sh
在这里下载http://www.eclipse.org/jgit/download/