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 Both sides next revision
git:faq [2009/10/30 14:52]
janakj
git:faq [2009/10/30 15:44]
janakj
Line 1: Line 1:
 +~~NOTOC~~
 ====== Git Frequently Asked Questions ====== ====== Git Frequently Asked Questions ======
 ==== How do I tell git to ignore my local changes to file XYZ from the repository? Can I use .gitignore for that? ==== ==== How do I tell git to ignore my local changes to file XYZ from the repository? Can I use .gitignore for that? ====
Line 23: Line 24:
   $ git checkout -b master_old origin/master@{"1 week ago"}   $ git checkout -b master_old origin/master@{"1 week ago"}
  
 +==== How can I push my local branch into the shared repository? ====
 +
 +**Question**:
 +
 +If I push my local branch 'abcd' into the shared repository, it seem that git wants to create a new branch:
 +
 +  $ git push origin abcd --dry-run
 +  To ssh://username@git.sip-router.org/sip-router
 +  * [new branch] abcd -> abcd
 +
 +Which is not what I really want, I want to push it into the existing master branch instead.
 +
 +**Answer**:
 +
 +You need to specify the name of the branch in the remote repository
 +you want to push to if the name of the local branch and the name of
 +the remote branch are not same:
 +
 +  $ git push origin abcd:master
 +
 +If you omit the name of the destination branch after colon then git assumes that it is the same as the name of your source branch.
  

Navigation

Wiki

Other

QR Code
QR Code git:faq (generated for current page)