I’m doing a pull origin some_branch and can see there are a lot of changes. Eventually I don’t mind if their erase all mine.
How can I accept them all instead or using mergetool and merge files one by one?
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.
Just:
Seriously! That’s the best way.
You could do all sorts of
git resetandgit branchcommands to move the refs, but the only purpose would be to keep your commits somewhere in your local repository for future reference. If that’s the goal, just keep the whole repository as is, and re-clone the origin.To accept all changes on just one branch,
foo:foowill now point at the same commit asfooonorigin. If you want to blow away the files in your working directory, add--hardtogit reset. If you want to merge first, replacefetchwithpull.You may have a bunch of dangling commits in your local repo, which git may clean-up someday, but for awhile you can still access them via the reflog.