Git...tips and tricks

Git is a very powerful version controlling system. Here are some tips and tricks which I found were not that obvious! :)

Merge
Merging takes a bit of practice in Git. As compared to ClearCase, merging is not that user friendly, but it's damn fast!
-- While merging from two of the git branches, ensure that each branch should be at it's desired commit-id. To ensure, checkout each branch, verify it's status (either by Hash value or Tag), and the perform merge.
-- If the merge is temporary or for some trial, use git merge --no-commit , so that merge is not commited. By using git add or by UI later the commit can be performed.

Add
Many a times, add does not work via UI. A right click and Git-->add.... does not work for many reasons. A reason I found, was .gitignore. Support a path is configured as ignore path, then UI will not throw any error and simply will show blank screen.
--Always, try git add from prompt to know cause of failure.

Comments