[Kde-pim] Re: Pushing a single commit in git

Alex Merry kde at randomguy3.me.uk
Mon Jan 3 22:34:47 GMT 2011


On Monday 03 Jan 2011 22:00:18 David Jarvie wrote:
> I've alread committed various changes, including the single one I want to
> push. Is there any way to create a new branch without any of my local
> commits, so that I can then apply the change to the single file in the
> local repository, and then push the change for that file only? Or would I
> have to download the whole repository again before making that change?

You could do something like
git branch <branchname> origin/master
to create a branch based on upstream master.

If you want to push one commit, cherry-pick that (git help cherry-pick), 
otherwise just make the change and commit that.  To push, you want to do
git push origin <branchname>:master
(<branchname>:master tells git to push the local branch <branchname> to the 
remote branch 'master' - without this, git will simply look for local branches 
with the same name as remote branches, and end up trying to push local master 
to remote master).

Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20110103/da490200/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list