Hi all, I'm not really satisfied about the our usage [1] of git. The biggest problem I see is, that after a 'git pull' and local modifications a 'git push' could fail if someone other has modified the "master"-repo on crux.nu in the meantime. The only solution I found is a 'git pull -f' which will undo the local changes. Maybe we can solve this issue by using a special branch at our local boxes in a way like this: git pull origin # update local repo git checkout -b jue 2.2 # create local branch jue from 2.2 ... add/change/commit # do the usual changes in branch jue ... git checkout -f 2.2 # switch back to our main branch git pull origin # update local repo git pull . jue # merge changes from branch jue git push origin # update repo on crux.nu If something goes wrong with the last step we can just do a 'git pull -f' and do the merge again. If everything is fine delete the local branch: git branch -d jue The only drawback I can see so far is the additional commit message in the log about the merge. Sound this reasonable or is there a better way ? Greetings Juergen [1] http://crux.nu/Main/ContribHowTo -- Juergen Daubert | mailto:jue@jue.li Korb, Germany | http://jue.li/crux
Juergen Daubert [2006-11-05 15:09]:
The biggest problem I see is, that after a 'git pull' and local modifications a 'git push' could fail if someone other has modified the "master"-repo on crux.nu in the meantime. The only solution I found is a 'git pull -f' which will undo the local changes.
Just run "git pull", which will merge the origin repo's branch into your current one (generating a "foo merged into bar" commit). Afterwards, just "git push" as usual. These "merge commits" are a bit ugly, and I think I've heard you can get rid of them if you use "git fetch" followed by "git rebase", but I'm not sure on that. I'll look into the latter. Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
Tilman Sauerbeck [2006-11-05 15:56]:
These "merge commits" are a bit ugly, and I think I've heard you can get rid of them if you use "git fetch" followed by "git rebase", but I'm not sure on that. I'll look into the latter.
git fetch git rebase origin Seems to do the trick. This is only necessary if a "git push" failed though. If you don't have pending commits, you can just run "git pull". Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
On Sun, Nov 05, 2006 at 04:06:21PM +0100, Tilman Sauerbeck wrote:
Tilman Sauerbeck [2006-11-05 15:56]:
These "merge commits" are a bit ugly, and I think I've heard you can get rid of them if you use "git fetch" followed by "git rebase", but I'm not sure on that. I'll look into the latter.
git fetch git rebase origin
Seems to do the trick. This is only necessary if a "git push" failed though. If you don't have pending commits, you can just run "git pull".
Cool, that's much better, thanks Tilman. I've added this to our wiki-page [1]. regards Juergen [1] http://crux.nu/Main/ContribHowTo -- Juergen Daubert | mailto:jue@jue.li Korb, Germany | http://jue.li/crux
participants (2)
-
Juergen Daubert
-
Tilman Sauerbeck