How to pull files from the repository without generating merge commit?

Asked

Viewed 576 times

3

How can I get new files from the repository without committing Merge branch 'master' of...?

I’m using:

git pull

It pulls everything cool, however, creates this merge commit. How do I only have commits from the remote repository, ignoring this cool merge commit?

1 answer

2


You can do git rebase:

git pull --rebase

So git will put all the their commits at the top of the remote branch commits, without committing to merge. This is a very common complaint when using Git, because without having this habit of using rebase you end up having these merge commits "dirty" the branches.

However, when a conflict occurs, git rebase is not the best option.

  • 2

    If your HEAD is dirty, can make a git stash to hide this filth. I usually do git stash && git pull --rebase && git stash pop, that hides the dirt, makes the rebase and dirty again

Browser other questions tagged

You are not signed in. Login or sign up in order to post.