Configure default options (version control tip)

For everything you need to know about version control, check out Version control – Everything you need to know, on Programming Duck.

With certain git commands, you may always use certain options.

For example, you may always use the --rebase option with the git pull command (git pull --rebase).

In that case, you could modify your global git configuration file to always use that option, even if you don’t include it in the command. For example, you can make the command git pull be equivalent to git pull --rebase.

You can also do the same for any other option and command.

To do this, you can modify your global git configuration file directly:

// .giconfig

[pull]
  rebase = true

Alternatively, you can change the configuration from the terminal, with a command such as git config --global pull.rebase true.

The exact configuration you need to change depends on the specific command and option. Unfortunately, there are too many to list here. If you want more information on configuring git, I recommend reading the git config tutorial by Atlassian. However, it may be faster to use a search engine and search for the exact configuration you need for the option you’re trying to add.

Final notes

That’s it for this article.

If you have any feedback, or even counter-arguments, please let me know in the comments.

Next, if you want to know more about version control, please see the article Version control – Everything you need to know.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments