简体   繁体   中英

GIT hard reset all from local folder (overwrite only on localhost)

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM