Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git pull remote branch causes a merge commit if the branch is different than the current one #7

Closed
nfriedly opened this issue May 19, 2015 · 1 comment

Comments

@nfriedly
Copy link

I have a site that uses docpad-plugin-repocloner, and I noticed that it was causing merge commits, merging the new branch into the current one every time I change branches.

@nfriedly
Copy link
Author

I think

git fetch <remote>
git checkout <branch>
git merge <remote>/<branch>

is the closest option to the current behavior, but

git fetch <remote> 
git reset --hard <remote>/<branch>

might be a safer alternative to guarantee that the local repo matches the remote one.

nfriedly added a commit to nfriedly/safeps that referenced this issue May 20, 2015
Rather than performing a git pull, (which merges the desired branch into the current one, even if they aren't the same), this ensures the repo is on the correct branch before merging.
Fixes bevry#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant