* How to push the very last modification only ?
@ 2011-07-18 7:47 J. Bakshi
2011-07-18 8:58 ` Chris Packham
0 siblings, 1 reply; 4+ messages in thread
From: J. Bakshi @ 2011-07-18 7:47 UTC (permalink / raw)
To: git
Hello list,
I have found that during push, all local commit goes into the git server. Where I like to only push the very last modification with a meaningful comment which will be available at the git server. How can I then push only the last modified one ?
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to push the very last modification only ?
2011-07-18 7:47 How to push the very last modification only ? J. Bakshi
@ 2011-07-18 8:58 ` Chris Packham
2011-07-18 16:49 ` Drew Northup
2011-07-19 6:07 ` J. Bakshi
0 siblings, 2 replies; 4+ messages in thread
From: Chris Packham @ 2011-07-18 8:58 UTC (permalink / raw)
To: J. Bakshi; +Cc: git
Hi,
On 18/07/11 19:47, J. Bakshi wrote:
> Hello list,
>
> I have found that during push, all local commit goes into the git
> server.
Yes that's the normal behaviour. When you think about what push is doing
it's trying to make the remote branch the same as your local branch.
> Where I like to only push the very last modification with
> a meaningful comment which will be available at the git server. How
> can I then push only the last modified one ?
This is easily doable. What you need to do is prepare a branch that you
do want to push. Something like this, assuming that your current branch
is 'master' and you want to push to origin/master:
# first create temporary a branch to use while you're delivering
git checkout -b delivery origin/master
# now cherry pick the commits you do want to push. I usually use
# gitk and cherry-pick from the right-click menu, but for simplicity
# I'll use git cherry-pick here.
git cherry-pick master
# you can provide a commit id instead of 'master'.
# at this point you could also use git commit --amend to add any
# final tweaks to the commit
# check that your delivery branch is good using git log/gitk. Build,
# test, etc
# now push it to your local delivery branch to the remote master
# branch
git push origin delivery:master
# now do some cleanup
git checkout master
git branch -d delivery
git rebase origin/master
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to push the very last modification only ?
2011-07-18 8:58 ` Chris Packham
@ 2011-07-18 16:49 ` Drew Northup
2011-07-19 6:07 ` J. Bakshi
1 sibling, 0 replies; 4+ messages in thread
From: Drew Northup @ 2011-07-18 16:49 UTC (permalink / raw)
To: J. Bakshi; +Cc: Chris Packham, git
On Mon, 2011-07-18 at 20:58 +1200, Chris Packham wrote:
> Hi,
>
> On 18/07/11 19:47, J. Bakshi wrote:
> > Hello list,
> >
> > I have found that during push, all local commit goes into the git
> > server.
>
> Yes that's the normal behaviour. When you think about what push is doing
> it's trying to make the remote branch the same as your local branch.
>
> > Where I like to only push the very last modification with
> > a meaningful comment which will be available at the git server. How
> > can I then push only the last modified one ?
>
> This is easily doable. What you need to do is prepare a branch that you
> do want to push. Something like this, assuming that your current branch
> is 'master' and you want to push to origin/master:
<snip>
Another way to do what Chris describes is to use Interactive Rebase (git
rebase -i) to squash commits together. Please read the manual page for
that carefully before using it on a production repository.
--
-Drew Northup
________________________________________________
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to push the very last modification only ?
2011-07-18 8:58 ` Chris Packham
2011-07-18 16:49 ` Drew Northup
@ 2011-07-19 6:07 ` J. Bakshi
1 sibling, 0 replies; 4+ messages in thread
From: J. Bakshi @ 2011-07-19 6:07 UTC (permalink / raw)
To: Chris Packham; +Cc: git
On Mon, 18 Jul 2011 20:58:51 +1200
Chris Packham <judge.packham@gmail.com> wrote:
> Hi,
>
> On 18/07/11 19:47, J. Bakshi wrote:
> > Hello list,
> >
> > I have found that during push, all local commit goes into the git
> > server.
>
> Yes that's the normal behaviour. When you think about what push is doing
> it's trying to make the remote branch the same as your local branch.
>
> > Where I like to only push the very last modification with
> > a meaningful comment which will be available at the git server. How
> > can I then push only the last modified one ?
>
> This is easily doable. What you need to do is prepare a branch that you
> do want to push. Something like this, assuming that your current branch
> is 'master' and you want to push to origin/master:
>
> # first create temporary a branch to use while you're delivering
> git checkout -b delivery origin/master
>
> # now cherry pick the commits you do want to push. I usually use
> # gitk and cherry-pick from the right-click menu, but for simplicity
> # I'll use git cherry-pick here.
> git cherry-pick master
> # you can provide a commit id instead of 'master'.
>
> # at this point you could also use git commit --amend to add any
> # final tweaks to the commit
>
> # check that your delivery branch is good using git log/gitk. Build,
> # test, etc
>
> # now push it to your local delivery branch to the remote master
> # branch
> git push origin delivery:master
>
> # now do some cleanup
> git checkout master
> git branch -d delivery
> git rebase origin/master
>
>
It works !! Many many thanks :-)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-07-19 6:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-18 7:47 How to push the very last modification only ? J. Bakshi
2011-07-18 8:58 ` Chris Packham
2011-07-18 16:49 ` Drew Northup
2011-07-19 6:07 ` J. Bakshi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.