Both sides previous revision
Previous revision
|
Last revision
Both sides next revision
|
git:quick-start-guide [2009/04/22 20:56] andrei added note about using rebase by default for master |
git:quick-start-guide [2009/04/23 11:30] andrei added note about autosetuprebase |
Some other recommended git config setting: | Some other recommended git config setting: |
| |
* include summaries of merged commits in commit merge messages (a MUST) | * include summaries of merged commits in commit merge messages (a **MUST**) |
<code> | <code> |
git config --global merge.log true | git config --global merge.log true |
git config --global branch.autosetupmerge always | git config --global branch.autosetupmerge always |
</code> | </code> |
* by default perform a rebase instead of a merge when pulling into the local master branch (highly recommended, it gets rid of a lot of confusing merge origin/master messages). It's equivalent to adding **--rebase** to git pull command line. | * by default perform a rebase instead of a merge when pulling into the local master branch (highly recommended, it gets rid of a lot of confusing merge origin/master messages). It's equivalent to adding **--rebase** to git pull command line. (**recommended**) |
<code> | <code> |
git config branch.master.rebase true | git config branch.master.rebase true |
</code> | </code> |
* by default use --no-ff when merging into master (this means that a merge commit message will be generated for all merges; without it fast-forward merges will not generate a merge message). **Note**: --no-ff will generate merge logs even when updating master from origin (git pull origin master), which is not what you want. You should either use "-**-no-ff**" by default like described below, but then make sure to add "**--ff**" every time you update your local master version (git pull **--ff** origin master), or you don't use it, but then always remember to add "-**-no-ff**" when merging some other branch into master (e.g.: git merge **--no-ff** origin/foo). | * by default setup all new local branches to perform rebase (like above) when pull-ing (so that you don't have to run //git config branch.%%<branchname>%%.rebase true// for each of them). |
<code> | <code> |
# recommended _only_ if you do a _lot_ of merges between public branches | git config branch.autosetuprebase always # or remote |
# (see Note: above), otherwise you're better off without it in the config | </code> |
| * (**not recommended**) by default use --no-ff when merging into master (this means that a merge commit message will be generated for all merges; without it fast-forward merges will not generate a merge message). **Note**: --no-ff will generate merge logs even when updating master from origin (git pull origin master), which is not what you want. You should either use "-**-no-ff**" by default like described below, but then make sure to add "**--ff**" every time you update your local master version (git pull **--ff** origin master), or you don't use it, but then always remember to add "-**-no-ff**" when merging some other branch into master (e.g.: git merge **--no-ff** origin/foo). |
| <code> |
| # _not_ recommended, use _only_ if you do a _lot_ of merges between public |
| # branches (see Note: above), otherwise you're better off without it |
# git config branch.master.mergeoptions "--no-ff" | # git config branch.master.mergeoptions "--no-ff" |
</code> | </code> |