Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
git:commit-into-master [2009/04/22 18:43]
andrei error on push
git:commit-into-master [2009/10/08 17:53]
andrei
Line 4: Line 4:
 If you want to push some changes you did in some other local branch, just replace //master:master// If you want to push some changes you did in some other local branch, just replace //master:master//
 in //git push origin master:master// with //git push origin **HEAD**:master//. in //git push origin master:master// with //git push origin **HEAD**:master//.
 +  * first see what will be pushed
 +<code>
 +$ git fetch origin; git log origin/master..HEAD
 +# alternatively you could try git whatchanged origin/master..HEAD
 +# instead of git log and/or add --graph --color to git log / git whatchanged
 +</code>
  
-  * first try a push directly (1)+  * try a push directly (1)
 <code> <code>
 $ git push origin master:master $ git push origin master:master
Line 20: Line 26:
  
 <code> <code>
 +$ git fetch
 $ git pull --ff --rebase origin master $ git pull --ff --rebase origin master
 </code> </code>
Line 50: Line 57:
 </code> </code>
  
- * if you get a merge conflict then fix-it and proceed as instructed (edit the file with the conflict, use git add <filename> and then git rebase --continue).+  * if you get a merge conflict then fix-it and proceed as instructed (edit the file with the conflict, use git add <filename> and then git rebase --continue).
    
-**NOTE:** you could update your branch (3) also with //git pull --ff// (no //--rebase//), but then a confusing merge commit message will be recorded, so it's highly recommended to use the //--rebase// method above.+**NOTE:** you could update your branch (3) also with //git pull --ff// (no //--rebase//), but then a confusing merge commit message will be recorded (e.g.: "Merge branch 'master' of %%ssh://git.sip-router.org/sip-router%%"), so it's highly recommended to use the //--rebase// method above.
  
   * if when trying the rebase you get something like:   * if when trying the rebase you get something like:
Line 59: Line 66:
 refusing to pull with rebase: your working tree is not up-to-date refusing to pull with rebase: your working tree is not up-to-date
 </code> </code>
- it means you have some uncomitted local changes. Commit them (//git add ...// && //git commit//) and try again.+ it means you have some uncomitted local changes. Commit them (//git add ...// && //git commit//) or save them for latter use/review (//git stash save "local changes"//) or 
 + discard them (//git checkout file_with_changes// or //git reset --hard HEAD//) and then try again.

Navigation

Wiki

Other

QR Code
QR Code git:commit-into-master (generated for current page)