Hooman,
Good call on performing a rebase before the merge request. I had been branching the code and not attempting to reconcile it with the main branch until after the merge commit was completed. Since I've been averaging about 2-3 branches open at once and pushing occasional simple commits directly on the repo, the branches become stale before the merge commit.
I really like the rebase feature that allows me to move my branch into the future from where it's original base commit. Reconciling more often makes the branch easier to work in. I could see this being really helpful if working on a team where a lot of people are merging in branches and you want to check your current work against their changes often.
I'll try using the rebase command more often now.
I'd also be curious as to your experiences if you've ever tried to rebase after creating a pull request. At that point, you are technically rewriting history that is now public to the pull request.
Well, not much to say here. I have used GitHub to perform both Squash and Merge & Rebase and merge. I just click the button and it works. For a squash and merge, GitHub allows you to modify the commit message just like you would when squashing commits locally. The GitHub documentation states that you can disable Squash and merge and/or Rebase and merge on a repository. I suspect they allow disabling because as you stated someone is re-writing history on a public branch to perform either action. Also, there is the blurb below, which I'm not sure means anything to me at my current knowledge of Git. (Shrugs)
From
https://help.github.com/articles/about-pull-request-merges/The rebase and merge behavior on GitHub deviates slightly from git rebase. Rebase and merge on GitHub will always update the committer information and create new commit SHAs, whereas git rebase outside of GitHub does not change the committer information when the rebase happens on top of an ancestor commit.
On a slightly different note, I've been using the Git Stash command lately. Once when I started working on a new feature but forgot to switch out of a branch before starting work. Git wouldn't let me switch out of the branch without recording the changes. I just stashed them, created the new branch, and then used stash pop to move the changes into the new branch.
One of the times I used stash / stash pop, I caused merge conflicts, but I was able to resolve them pretty much just like I would resolve them on a merge commit.
I've found TortoiseGit's tool for resolving merge conflicts very good. I like it more than using KDiff, which is what I use with TortoiseHG. KDiff is a fine tool, especially for being free, so I'm not bashing it by any means.
I would be really curious which workflow was easier/faster for someone that mastered both, using the command line for Git or using TortoiseGit. Perhaps someday I'll try switching to the command line but for now TortoiseGit has been able to perform everything I've needed.
Thanks,
Brett