[Kde-games-devel] Trouble with branch KDE/4.12
Albert Astals Cid
aacid at kde.org
Sun Dec 29 15:26:35 UTC 2013
El Diumenge, 29 de desembre de 2013, a les 13:37:06, Ian Wadham va escriure:
> Hi Albert,
Hi there,
> I am getting into a worse and worse mess with this. I am trying to follow
> your suggestion to commit the bug 310411 fix in 4.11 first and then
> merge forward, step by step, into 4.12 and master. So far I have
> succeeded with the 4.11 and 4.12 steps and am ready to do the
> "master" steps.
>
> Trouble is that I had already committed the bug fix on my local master,
> a day or two ago, and I already have at least one other branch that includes
> the fix and one or two branches that don't (e.g. the Preview feature which
> is currently under review).
>
> I really want to avoid having the "merge from 4.12" history and my own
> local master history both appearing on the central repository.
>
> I tried "git revert" on my local master's copy of the fix, but that only
> added another bit of history (for the revert). Then I tried
> "git checkout origin/master", hoping that would re-synchronise my
> local master with KDE base, but no such luck: I went into an alarming
> [no branch] state, with a message that began "You are in 'detached HEAD'
> state. …". So I quickly did "git checkout master" and got back to where I
> was before.
> Do I need to save all my local edits (e.g. as .patch files) and then
> make a fresh clone of Palapeli? Or is there some easier way to
> simplify the local history to omit my commits to local master?
> Much of the coding I am doing ATM is experimental and I would
> not weep too much if I lost some of it.
If you want to kill everything you had (i.e. "re-synchronise my local master
with KDE master") you have to do
Note that this will *delete* and *vanish* any of the changes you had
git checkout master <-- make sure you're in the local master branch
git reset --hard origin/master <-- reset the local master to the remote master
Now if you want to keep your changes that you don't want to commit yet
somewhere I would do this (not sure if it's the best thing I am not a super
git expert either)
git log origin/master..master
To know the commits you have between the "remote master" and your local
master. There note the sha1sum of the commit and then save them with
git show $sha1commit > some_file_for_later_number_N
for each of the commits.
This way you can still keep the code you made and add it back later with
patch.
Since you've had some troubles, i'd also do
git diff master origin/master
before commiting to make sure you are pushing what you want to push.
Hope this helps :)
Cheers,
Albert
>
> Confused, Ian W.
>
> On 29/12/2013, at 11:44 AM, Ian Wadham wrote:
> > Thanks, Albert.
> >
> > On 29/12/2013, at 11:29 AM, Albert Astals Cid wrote:
> >> El Diumenge, 29 de desembre de 2013, a les 11:10:18, Ian Wadham va
escriure:
> >>> Albert, as you can see I have pushed the fix for bug 310411
> >>> (Palapeli Puzzle restart crash) into branch KDE/4.11 and thus
> >>> closed the bug, following the sequence you gave me (below),
> >>> which was on Review 114674.
> >>>
> >>> git checkout KDE/4.11
> >>> make the changes
> >>> git commit -a
> >>> git push origin KDE/4.11
> >>> git checkout KDE/4.12
> >>> git merge origin/KDE/4.11
> >>> git commit -a
> >>> git push origin KDE/4.12
> >>> …
> >>>
> >>> However, I am stuck on "git checkout KDE/4.12". It gives an
> >>> error message:
> >>>
> >>> error: pathspec 'KDE/4.12' did not match any file(s) known to git.
> >>>
> >>> "git checkout origin/KDE/4.12" gives the same error message.
> >>>
> >>> Same again if I switch to branch master and then try the same
> >>> two commands to check out 4.12.
> >>>
> >>> Any ideas?
> >>
> >> Maybe your clone is old and doesn't know about the existance of the
> >> KDE/4.12 branch.
> >>
> >> Does
> >> git pull --rebase
> >> help?
> >
> > That did the trick. It gave me the message:
> > * [new branch] KDE/4.12 -> origin/KDE/4.12
>
> _______________________________________________
> kde-games-devel mailing list
> kde-games-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kde-games-devel
More information about the kde-games-devel
mailing list