[Plone-conference] A tip about working with git at sprints
Gil Forcada
gforcada at gnome.org
Sun Oct 14 08:44:31 UTC 2012
You can add this to your .bashrc or whichever profile you have:
alias gitlog='git log --graph --decorate --pretty=oneline
--abbrev-commit --all'
source the file (on a terminal "source .bashrc") and run gitlog on any
repository you have. You will see a nicely formatted history with all
the merges and so on.
This way you will early notice if you are not needed merge commits.
I usually create a temporal branch to try how to fix the unneeded rebase
and once I'm happy with the result I do that on the branch itself.
Cheers and happy sprinting!
El dg 14 de 10 de 2012 a les 03:19 +0200, en/na Anatoly Bubenkov va
escriure:
> you rock, thanks
>
> On Sunday, October 14, 2012, Domen Kožar wrote:
> git config --global branch.autosetuprebase always
>
> On Sun, Oct 14, 2012 at 2:04 AM, Mikko Ohtamaa
> <mikko at opensourcehacker.com> wrote:
>
>
> On Sun, Oct 14, 2012 at 2:49 AM, Domen Kožar
> <domen at dev.si> wrote:
> I have alias for pull setup in global git
> config file to do it by default. And when
> there is a lot to rebase, I'll just pull it to
> temporary branch and merge it.
>
> Can you please share how you do this?
>
>
>
> On Sun, Oct 14, 2012 at 1:40 AM, Maurits van
> Rees <m.van.rees at zestsoftware.nl> wrote:
> Op 14-10-12 01:29, David Glick
> schreef:
>
> In thanks for your gittips,
> here is a "git tip" for you:
> When we have sprints and lots
> of people are working on the
> same package at once, the git
> commit log tends to get
> cluttered with lots of merge
> commits that look like "Merge
> branch 'master' into
> ploneconf2012". This happens
> because while you were making
> your commit, someone else
> already pushed a new one to
> github, so when you pull git
> makes a new commit to merge
> the two changes.
>
> Instead of doing "git pull,"
> you can do "git pull
> --rebase". This will make git
> redo your commit(s) after the
> one(s) that happened on
> github, so that no additional
> merge commit is necessary
> unless something conflicts.
>
>
> Ah, I have not used that one yet.
> Should work nicely, thanks. I
> usually do interactive rebases.
>
> In case you have already done a normal
> git pull and you have ended up in the
> situation David mentions, you can also
> do `git rebase -i HEAD^^` to
> interactively rebase the last two
> commits (or more, if you add more
> carets). If you have not done this
> before, you may want to first make a
> quick copy or tarball of your clone,
> just to be safe.
>
> If this scares you (it should not),
> then ask a fellow sprinter to assist
> you. It should not take long.
>
> If it still scares you, simply do what
> you have done until now: do a git pull
> and push your changes without worrying
> about all this. Getting your fixes
> committed and pushed upstream is more
> important than how the commit message
> looks. But: it is a worthwhile skill
> to have.
>
>
> _______________________________________________
> Plone-conference mailing list
> Plone-conference at lists.plone.org
> http://lists.plone.org/mailman/listinfo/plone-conference
>
>
--
Gil Forcada
[ca] guifi.net - una xarxa lliure que no para de créixer
[en] guifi.net - a non-stopping free network
bloc: http://gil.badall.net
planet: http://planet.guifi.net
More information about the Plone-conference
mailing list