
git clean -df 清除暫存區(qū) 當有很有無用的東西時,可以暫時暫存進去,不用修改
git fetch -p 刷新分支 更新一下線上的分支
git cherry-pick commit-id 提交指定的內(nèi)容
git checkout publish 基于修改的主分支
git pull origin publish 記得更新一下
git checkout -b zjx-sem 創(chuàng)建分支并切換
git add .
git commit -m 'zjx'
git checkout develop
git pull origin develop
git merge zjx-sem
git push origin develop
zjx-sem 本地的分支 ------將其git push 就成為 origin zjx-sem 線上的分支
在拉取代碼的時候,git status 后發(fā)現(xiàn)有很多的暫存文件,可以先后退一個版本
git reset --hard
git stash: 備份當前的工作區(qū)的內(nèi)容,從最近的一次提交中讀取相關(guān)內(nèi)容,讓工作區(qū)保證和上次提交的內(nèi)容一致。同時,將當前的工作區(qū)內(nèi)容保存到Git棧中。
git stash pop: 從Git棧中讀取最近一次保存的內(nèi)容,恢復工作區(qū)的相關(guān)內(nèi)容。由于可能存在多個Stash的內(nèi)容,所以用棧來管理,pop會從最近的一個stash中讀取內(nèi)容并恢復。
git stash list: 顯示Git棧內(nèi)的所有備份,可以利用這個列表來決定從那個地方恢復。
git stash clear: 清空Git棧。此時使用git等圖形化工具會發(fā)現(xiàn),原來stash的哪些節(jié)點都消失了。
注釋:git stash詳解地址 :
http://www.cppblog.com/deercoder/archive/2011/11/13/160007.aspx
查看遠程分支 git branch -a
查看本地分支 git branch
刪除本地分支 git branch -d 分支
查看遠程分支版本 git remote
查看遠程分支版本 git remote -v
創(chuàng)建分支 git branch test
把分支推到遠程分支 git push origin test
切換分支到test git checkout test
創(chuàng)建分支并切換到test git checkout -b test