基礎的:
生patch:
git diff branchname --cached > patch
Push changes from your commit into your branch :
$ git push origin [name_of_your_remote]
刪除遠端 branch:
git push origin :your_branch
刪除本地branch:
git branch -d yourbranch
update remote branch:
http://blog.csdn.net/u012150179/article/details/17172211
2 ,从远程获取最新版本到本地
|
$ git fetch origin master
From https://github.com/com360/android-app
* branch master -> FETCH_HEAD
su@SUCHANGLI /e/eoe_client/android-app (master)
|
$ git fetch origin master 这句的意思是:从远程的origin仓库的master分支下载代码到本地的origin master
3. 比较本地的仓库和远程参考的区别
|
$ git log -p master.. origin/master
su@SUCHANGLI /e/eoe_client/android-app (master)
|
因为我的本地仓库和远程仓库代码相同所以没有其他任何信息
4. 把远程下载下来的代码合并到本地仓库,远程的和本地的合并
|
$ git merge origin/master
Already up-to-date.
su@SUCHANGLI /e/eoe_client/android-app (master)
|
加patch:
今天要打包最新的三個 commit 的話
git format-patch -3
此時 git 便會幫你產生3個類似下列的檔案
0001-First.patch
0002-Second.patch
0003-Third.patch
2.那如果要套用別人的patch 也相當簡單
git am 0001-First.patch
就將 patch apply 上去了
================================
刪除錯誤提交commit:
方法:
git reset --hard
git push origin HEAD --force
Git patch 合併有衝突的話:
http://www.fwolf.com/blog/post/448