Take the 2-minute tour ×

I have my own Git server and I would like to set Git Fetch and Rebase as the default operation of 'git pull'.

I like this configuration to remain on the server so whoever that clones the repository wouldn't need to do any configuration?

Thank you.

share|improve this question

2 Answers 2

You should use git pull --rebase to do this. You can map it to an alias like this:

$ git config --global alias.rebasepull 'pull --rebase'

Now you can use git rebasepull instead of the previous command. You can't override GIT commands though.

share|improve this answer
Thanks for the comment. However, thats not what I was looking for. I want to change the behavior of 'git pull' from 'Fetch & Merge' to 'Fetch & Rebase'. I also know how to set it up for my local repo, but not the remote repo. –  Mo Firouz Jan 6 '13 at 0:05
You can't set something in the remote repo and use it in your repos. The remote only stores the repo, it doesn't modify it or modify it's clones. –  Wouter J Jan 6 '13 at 0:16

You can configure it on the client with

git config branch.branchname.rebase true


git config branch.autosetuprebase always

But git doesn't have any way to push config from a server to a client; the best you can do is to put this in documentation somewhere, and/or establish a culture where people run a script upon cloning a repo that sets up config and hooks, and put those commands in that script.

share|improve this answer

Your Answer


