命令行指引
Git 全局設(shè)置
git config --global user.name "*****"
git config --global user.email "****@test.com"
創(chuàng)建一個新存儲庫
git clone http://192.168.1.10:8080/user/apptest.git
cd apptest
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
現(xiàn)有的文件夾
cd existing_folder
git init
git remote add origin http://192.168.1.10:8080/user/apptest.git
git add .
git commit -m "Initial commit"
git push -u origin master
現(xiàn)有的Git存儲庫
cd existing_repo
git remote rename origin old-origin
git remote add origin http://192.168.1.10:8080/user/apptest.git
git push -u origin --all
git push -u origin --tags
代碼拉取
git pull
你的本地Git倉庫目錄
cd /APP/deploy/
查看當(dāng)前分支
git branch
新建test-01分支枣申,并切換到test-01分支
git checkout -B test-01
git branch
拉取遠(yuǎn)程master代碼到本地分支
git pull origin master:test-01
修改test.go文件 #這里你可進(jìn)行任何更新操作售葡。
vim test.go
查看當(dāng)前狀態(tài)
git status
添加文件
git add test.go
commit File,-m后是本次提交備注忠藤。
git commit -m "更新test.go 文件"
push本次修改挟伙,以及本地的test-01分支到遠(yuǎn)程test-01r分支。
git push origin test-01:test-01