How To Overwrite Local Changes In Git
If you experience the need to discard all your local changes and just reset/overwrite everything with a copy from the remote branch, and then y'all should follow this guide.
Important : If y'all take any local changes, they will exist lost. With or without –hard option, any local commits that haven't been pushed will exist lost.
If you accept any files that are not tracked by Git (e.g. uploaded user content), these files will not be afflicted.
The Overwrite workflow:
To overwrite your local files practice:
git fetch --all
git reset --hard <remote>/<branch_name>
For instance:
git fetch --all
git reset --hard origin/master
This will give message like below
Caput is now at f2**a6* adding last_commit_name
Thanks for reading.
Keep Coding.
Git fundamental using github crash tutorials may 2020 – By DevOpsSchool
- Author
- Recent Posts
Source: https://www.devopsschool.com/blog/how-to-overwrite-local-files-with-git-pull/
Posted by: phillipsnobjess76.blogspot.com
0 Response to "How To Overwrite Local Changes In Git"
Post a Comment