• Uncategorized

About linux : GIT-hard-reset-all-from-local-folder-overwrite-only-on-localhost

Question Detail

I have some problems with my project so i need to pull all from master again.

When i type git pull it give me that is everything is all up to date, but i can see on my project that my project have some issues on my local.

How i can pull all from master, but i need to rewrite all files from master to my localhost?

Really important is that i need to rewrite files just on my local from master, because i work for company and if anything happen to project it will be my foul 🙂

I have tried with --hard too, but nothing changes.

Question Answer

To make your local master identical to its remote counterpart :

# let's save your local changes (if any)
git stash

# make sure to be on master branch
git checkout master

# let's save your current master branch (to allow for rollback)
git branch backup_old_master

# make sure to get last version of remotes
git fetch

# reset to remote version
git reset --hard origin/master

You may also like...

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.