(1)ubuntu系统
可以直接使用"sudo apt-get install git"进行git的安装,非常简单方便
(2)配置git用户名和邮箱
git config --global user.name "Your Name"
git config --global user.email "Your Email"
(3)使用git clone url
下载远程git仓库代码,url可以从githup或gitlab上面查看代码的仓库地址
(4)新建一个测试文件,例如HelloWord.java文件
git add . 添加文件
git commit -m "commit code" 提交代码,这里只是提交到本地仓库
git push 推送到远程git服务器
(5)如果一个项目是多人合作开发,那如何更新别人提交的代码呢。
git pull 更新远程代码到本地
(6)配置免账号密码
cd ~
touch .git-credentials
gedit .git-credentials
输入https://{username}:{password}@github.com
,保存退出
git config --global credentials.helper store