I have just started using Git on Windows. I am hosting on BitBucket and using TortoiseGit as the windows client.
Things are moving in the right directon, but I am clueless at a point. I was working on the master branch, and at one point created a new branch. Then I continued working on the new branch and kept committing, pushing. Finally when I was done, I merged this new branch(codetidy) back into master.
Now when I do 'Show Log' and select 'All Branches', I just get a straight line in the graph. There is no information of from when a branch was taken out, and when it merged back. Please hep me find this information.
By default, git log includes merge commits in its output. But, if your team has an always-merge policy (that is, you merge upstream changes into topic branches instead of rebasing the topic branch onto the upstream branch), you'll have a lot of extraneous merge commits in your project history.
To do a merge (locally), git checkout the branch you want to merge INTO. Then type git merge <branch> where <branch> is the branch you want to merge FROM.
To merge branches locally, use git checkout to switch to the branch you want to merge into. This branch is typically the main branch. Next, use git merge and specify the name of the other branch to bring into this branch. This example merges the jeff/feature1 branch into the main branch.
That's probably because your merge was a fast-forward merge, which means that there weren't any commits made to master
in between the time when codetidy
was created and when it was merged back in - so Git helpfully just moves master
to point to the same commit (because it already has the exact same file contents as what a merge would look like), rather than creating an unnecessary merge commit.
If you don't want this behavior, you'd need to force Git to create a separate merge commit - on the command line, this is done with git merge --no-ff
. In TortoiseGit, it's done via checking the "No Fast Forward" checkbox in the merge window (see this previous StackOverflow answer for a screenshot).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With