I can pull changes using git pull, but it merges my local commits. Is there a git rebase equivalent with which I can pull in remote changes?
I can pull changes using git pull , but it merges my local commits.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes you can
git pull --rebase.You can also set that to be the default pull behaviour when you track a branch with
git config branch.autosetuprebase always. Replace “always” with “remote” or “local” if you want to do it to those specific types of branches that you’re tracking.Now all you have to do is
git pull.If for some reason you want to do a merge, you can do
git pull --no-rebase.Hope this helps.
UPDATE: see comments below for how to do this on existing branches.