repo—git入門使用

南丶煙發表於2015-06-29

repo統一管理多個git倉庫

repo init -u URL 當前目錄下安裝倉庫,生成.repo

.repo/manifest.xml 指向TAG

repo sync 更新下載 ==> * (no branch)

repo start master –all ( git branch - * (no branch) => master)

repo branch 檢視專案下所有存在分支

git clone url 克隆程式碼倉庫 : git checkout + branch_name 下載

git status 狀態

git branch 分支名 -建立

git checkout 分支名 -切換

git branch -a 檢視當前倉庫所有的分支

git add 新增git管理中 當前下所有 .

git checkout – filename 去除修改 不做commit

git commit -a -m “” 強制 註釋上傳

git commit –amend 附加上一個commit 。可修改 註釋 change-id

修改 git 預設編輯器nano 為 vim :git config –-global core.editor vim

git reset –mixed HEAD~2 回退2步

git merge 分支名 與當前分支合併

git remote 檢視遠端倉庫

git fetch 遠端倉庫名 抓取遠端倉庫所有資料 / git merge 遠端分支 :本地分支 /git rebase 遠端分支名

gerrit 提交 gerrit push 遠端倉庫名 本地分支名:refs/for/遠端分支名

相關文章