Re: help with git push of single branch



On Sat, 2009-05-30 at 22:40 +0200, Kenneth Nielsen wrote:
> Hallo
> 
> Now it seems it is my turn to ask for help with git. What I did is the
> following, I have a local clone of gtk+ with two branches from the
> last time I had to commit a translation, master and gtk-2-16. Now I
> had to commit a new translation to master, but do nothing with the
> gtk-2-16 branch. So I did:
> 
> git checkout master
> git pull --rebase
> copy translation in and run intltool-update
> git commit da.po -m "Updated Danish translation" --author "..Left out.."
> git status (looked good)
> git push
> 
> but upon this last command I got the following error output:
> Counting objects: 7, done.
> Compressing objects: 100% (4/4), done.
> Writing objects: 100% (4/4), 10.43 KiB, done.
> Total 4 (delta 3), reused 0 (delta 0)
> To ssh://kennethn git gnome org/git/gtk+
>    64b8f4e..d2cd949  master -> master
>  ! [rejected]        gtk-2-16 -> gtk-2-16 (non-fast forward)
> error: failed to push some refs to 'ssh://kennethn git gnome org/git/gtk+'
> 
> and return code 1, which will make my commit script complain. Now I
> think I understand why it complains, it is probably because the
> gtk-2-16 branch is behind the server one, and so even though I don't
> want to commit anything to it, it still complains. Now my question is,
> can I limit the push command to a single branch? Something like
> 
> git push master
> 
> I have searched a little on the internet, but most places it seems
> that the guides say that you need more arguments after push to do
> this, but I don't understand which or why. I hope someone can help.

If you're going to give git push arguments to tell it
what to push, you also have to tell it where to push
to.  So the command you want is:

git push origin master

--
Shaun




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]