A short post to all those who have difficulty with repository hell. This Git command parts the sea, brings peace and makes the local repository die for your sins.
Especially in IntelliJ i was faced with this issue numerous times, not being able to switch branches without going through some kind of satanic IntelliJ ritual of saving the repo changes to a shelf.
The solution is here:
Force overwrite of local files from remote repository:
$ git fetch --all
$ git reset --hard origin/master
To download changes from some other branch
Use the following command:
$ git reset --hard origin/<insert_other_branch>
Git fetch
downloads latest updates from remote, but doesn't merge or rebase in local files.
Thank the lord! The repo is resurrected back to its stable form!
Top comments (0)