I want to overide my local project with an remote repository. So before I do something unedible, should I "just" do:
cd path/to/project
and then
git pull https://github.com/someuser/someproject.git
??
I want to overide my local project with an remote repository. So before I do something unedible, should I "just" do:
cd path/to/project
and then
git pull https://github.com/someuser/someproject.git
??
Probably git reset --hard origin/HEAD
is what you need. It will revert all changes not pushed to remote repository.
When you say override, this local project will be identical to remote repository?
If so,
How about go to a directory where you want to put it so cd path/to
Then,
git clone https://github.com/someuser/someproject.git
which will bring someproject into path/to. Fresh and new!
There are some things you should check. So if you try to change your repo to a new one. You can go to your .git/config
and change the path to the new repository. The repositories have to be identical.
Ich you have changed you can pull new changes from the new one with:
git pull origin branchname
Otherwise if you have local changes then you have to reset your branch first and then pull.
git reset --hard HEAD^
which reverts your changes to the last commit.