You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2020/02/05 10:02:32 UTC
Tips for working with git on Camel branches
Hi
When pushing to master branch or any branch for the matter. Then
please do a rebase first and apply your commits on top of the latest
code.
We want the git tree to be clean and not a "merge hell".
So what I usually do is
git pull --rebase
To have all the latest code from master, and then if there is
conflicts or what, then I fix them locally, and then I push on top of
that.
Or if you work on feature branches then
git co master
git pull --rebase
git merge --no-ff mybranchname
git pull --rebase
And I also have a git squash alias I used to compact N number of
commits (not always) but its good
git squash 3 (to compact last 3 commit into 1 - editor opens and you
can edit the commit message)
squash => !f(){ git reset --soft HEAD~${1} && git commit --edit
-m"$(git log --format=%B --reverse HEAD..HEAD@{1})"; };f
Anyone got other tips?
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: Tips for working with git on Camel branches
Posted by Omar Al-Safi <om...@oalsafi.com>.
Ah awesome! +1.
Sorry for my earlier commit
On Wed, Feb 5, 2020 at 11:02 AM Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> When pushing to master branch or any branch for the matter. Then
> please do a rebase first and apply your commits on top of the latest
> code.
>
> We want the git tree to be clean and not a "merge hell".
>
> So what I usually do is
>
> git pull --rebase
>
> To have all the latest code from master, and then if there is
> conflicts or what, then I fix them locally, and then I push on top of
> that.
>
> Or if you work on feature branches then
>
> git co master
> git pull --rebase
> git merge --no-ff mybranchname
> git pull --rebase
>
> And I also have a git squash alias I used to compact N number of
> commits (not always) but its good
>
> git squash 3 (to compact last 3 commit into 1 - editor opens and you
> can edit the commit message)
>
> squash => !f(){ git reset --soft HEAD~${1} && git commit --edit
> -m"$(git log --format=%B --reverse HEAD..HEAD@{1})"; };f
>
>
> Anyone got other tips?
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>