...
Another good resource is Think Like A Git, a site who's main page states "Git shouldn't be so hard to learn."
Finally, Git for Computer Scientists is an in depth explanation of how git works.
Git Merge Strategies
Git has many "strategies" you can use while merging. Read the following carefully:
...
PITFALL - must be run against every new checkout of the repository. I'm not sure if this means when you swap branches, but I suspect it may.
3) Ignoring whitespace changes when a rebase fails
Sometimes when you go to do a rebase that should be simple, git fails and tells you that the entire file has changed. It may output something like this.
Code Block |
---|
M pom.xml
<stdin>:15: trailing whitespace.
<groupId>log4j</groupId>
<stdin>:16: trailing whitespace.
<artifactId>apache-log4j-extras</artifactId>
<stdin>:17: trailing whitespace.
<version>1.1</version>
<stdin>:18: trailing whitespace.
</dependency>
<stdin>:19: trailing whitespace.
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors. |
This indicates that there have been whitespace changes. Unless you're using python however, these probably aren't relevant and letting git sort them out will work fine. To do this, pass the --ignore-whitespace option to rebase.
Alternatively, you could run this command to make it so whitespace is automatically ignored unless you want it to be relevant:
Code Block |
---|
git config --global apply.ignorewhitespace change |
This is documented under the git-apply man page.