[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: postpone push?
From: |
David Kastrup |
Subject: |
Re: postpone push? |
Date: |
Mon, 21 Jul 2014 11:34:00 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
Thomas Morley <address@hidden> writes:
>> If it isn't, we'll walk through any problems. The CG recipe cited is
>> not really helpful there. Personally, I just do
>>
>> git fetch
>> git rebase origin/master mybranch
>> git push origin HEAD:staging
>>
>> This will refuse pushing when staging is ahead of master.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> While it is possible to rebase on staging instead of master and push,
>> I usually prefer to let staging catch up with master (through patchy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> before doing my own push. In case someone else borked staging, I
>> avoid having to clean up my version of the branch in order to remove
>> the borked staging commits.
>>
>> Of course, checking with gitk before the push is still a good idea. I
>> don't use gitk actually but rather
>>
>> git log --decorate --graph
> Trying to do
> address@hidden ~/lilypond-git (dev/typo-cc)$ git push origin HEAD:staging
> returns
> To ssh://address@hidden/srv/git/lilypond.git
> ! [rejected] HEAD -> staging (non-fast-forward)
> error: failed to push some refs to
> 'ssh://address@hidden/srv/git/lilypond.git'
> hint: Updates were rejected because a pushed branch tip is behind its remote
> hint: counterpart. Check out this branch and integrate the remote changes
> hint: (e.g. 'git pull ...') before pushing again.
> hint: See the 'Note about fast-forwards' in 'git push --help' for details.
>
> 'git log --decorate --graph'
> returns
> * commit 61e7691619505561eaa46b96e0a0d9fe6617274d (HEAD, dev/typo-cc)
> | Author: Thomas Morley <address@hidden>
> | Date: Sun Jul 13 13:45:03 2014 +0200
> |
> | typo/oversight in align-interface.cc and page-layout-problem.cc
> |
> | issue 4008
> |
> | fix oversight in doc-string of align-interface.cc
> | fix typo in comment of page-layout-problem.cc
> |
> * commit 4935f81a94ae1b98cd017a96571c153cee3e5686 (origin/master,
> origin/HEAD, master, dev/handle-grace)
You are perfectly fine here. However, origin/staging is _not_ listed
here as a reference: it has indeed moved ahead so that, like I stated,
git refuses to push.
At the current point of time, it appears to have caught up again. So
just do the
git fetch
git rebase origin/master mybranch
git push origin HEAD:staging
cycle again.
> Nevertheless,
> 'git push --help'
> confuses me more than helping.
I am not surprised. The focus of the Git man pages is being a reference
rather than a manual or tutorial.
--
David Kastrup