repo和git使用技巧
初始化git倉庫
repo init -u git://172.16.1.11/manifest.git -b 分支名稱 -m wanglei.xml
更新倉庫代碼
repo sync
啟動分支代碼
repo start 分支名稱 --all
下載新分支
repo forall -c git checkout -b 本地分支名稱(自定義) 服務器分支名稱
切換到另一個分支
repo forall -c git checkout your_branch
克隆分支下的某個git倉庫
git clone git://172.16.1.11/teset_dir/test.git -b test-dev
刪除分支
repo forall -c git branch -D 分支名稱
從本地代碼中,將最近一次的修改抽取成patch
git add -u
git commit -m "correct the wrong info of charger status"
git format-patch -1
從分支的提交記錄上抽取patch
git log
git format-patch 31accb599f63eadf07f606da9fe1e1b0fb728a65 -1
強制取消之前的修改,并恢復到最新版本
git reset --hard
將文件恢復到之前某個提交記錄的版本
git log 文件名
git reset commit號
git stash
把patch提交到本地,以patch owner的名義提交
git am patch名稱
以自己的賬號合入patch
patch -p1 < patch名稱
來自:http://blog.csdn.net/wlwl0071986/article/details/40832863
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!