0

I cloned a remote repository. I did not edit the repository, but git pull -rebase is telling me I need to commit changes first. I just want to overwrite and start with the current repository. I thought a pull would do that, but for some reason git thinks I edited the repo. Help!

1
  • Could you please explain your problem more clearly? It's a little hard to understand. Commented Dec 11, 2013 at 2:49

3 Answers 3

2
git fetch origin # get all branches from remote repo git reset --hard origin/master # discard whatever you have and switch to master branch of remote repo 
Sign up to request clarification or add additional context in comments.

2 Comments

Will the command change the files in the working directory? Need to reassure
Fornutately i took a backup before i tried your commands :) Yess the comands fetch and reset wiped replaced everything
1

Most simple solution would be to remove it and start over by cloning it again, you probably changed something by accident.

Comments

0

Maybe you're looking for git checkout -f to force a recheckout/revert of all files within the branch you're currently working in. Obviously, this will nuke all changes without much recourse.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.