How to Avoid Merging Hell on GitHub / BitBucket

In our repo, we get many of these trade-offs:

Merge branch 'master' of bitbucket.org:user/repo 

This happens every time a developer synchronizes his local fork with a top-level repo.

Anyway, to avoid this merger with hell, due to the clutter of the entire repo magazine? Is it possible to avoid them when initiating download requests in any way?

I know I can do git rebase if this is done only in my local virtual machine, is there any equivalence in the GitHub / BitBucket interface?

How do you guys do this?

+67
git bitbucket github
May 03 '13 at 11:58
source share
1 answer

Function separators before merging

If you want to avoid commits, you must ensure that all commits are fast. You do this by making sure that your function branch is completely reduced to your development line before merging:

 git checkout master git checkout -b feature/foo # make some commits git rebase master git checkout master git merge --ff-only feature/foo 

Rebase also has many flags, including an interactive reload with the -i flag, but you might not need it if you keep things as simple as possible and want to keep the whole history of your branches when merging.

Use the flag --ff-only

In addition to falsification, the use of the --ff-only flag ensures that only fast forward is allowed. The end will not be executed if a merge is performed instead. The git-merge (1) man page says:

- only ff

Refuse to merge and exit with a non-zero status if the current HEAD is already updated or the merge can be enabled as fast forward.

+90
May 03 '13 at 12:14
source share



All Articles