天天看點

git指令

==============版本管理者操作========================
第一步: 建立資料倉庫

git init --bare shared.git

==============開發人員1操作=============================

第二步:複制倉庫到本地

git clone /f/software/repository/git/shared.git/ . (注意有個點,表明目前目錄)

第三步:設定個人資訊

git config user.name "user1"
git config user.email "[email protected]"


第五步:建立一個檔案

echo "User1 add content" > index.jsp

第六步:送出檔案

git add index.jsp
git commit -m "User1 add the file"


第七步:把自己的倉庫送出到公共伺服器

git push origin master

==============開發人員2操作=============================

第八步:複制倉庫到本地

git clone /f/software/repository/git/shared.git/ .

第九步:設定個人資訊

git config user.name "user2"
git config user.email "[email protected]"

第十步:忽略無需版本控制的文檔

echo "*.txt" > .gitignore

第十一步:建立一個檔案

echo "User2 add content" >> index.jsp

第十二步:送出檔案

git add index.jsp
git commit -m "User2 add the file!"


第十三步:把自己的倉庫送出到公共伺服器

git push origin master


==============開發人員1操作=============================
第十四步:下載下傳伺服器最新資料

git pull

修改檔案 vim           

複制