我是Git的新手。请解释如何设置Git服务器并从客户端机器进行推/拉。我在客户端使用Eclipse Git。
答案 0 :(得分:1)
使用以下命令安装git
sudo apt-get install git
每个git用户都应该首先向git介绍自己
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
上述已经足以以分布式和安全的方式使用git,前提是用户可以通过SSH访问承担服务器角色的计算机。在服务器计算机上,可以使用
创建新的存储库git init --bare /path/to/repository
任何具有ssh访问权限的客户端都可以从那时起使用
克隆存储库git clone username@hostname:/path/to/repository
克隆到客户端的计算机后,客户端可以编辑文件,然后提交并与之共享:
cd /path/to/repository
#(edit some files)
git commit -a # Commit all changes to the local version of the repository
git push origin master # Push changes to the server's version of the repository
参考GIT