GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
Git Cleanup |
20201103 If things get confusing or go wrong, some salient advice from xkcd: delete the project, and download a fresh copy.
It does not always need to be that drastic. Things can go wrong when trying to merge upstream changes into your own local working copy before you then want to submit your changes either directly or through a pull request (the latter is recommended).
Git is pretty good at suggesting what to do at different stages of the workflow, so follow those suggestions.
Here's a few commands to try to get things back into sync when things seem to have gone wrong.
A local repository may retain known branches over time even though they get deleted from the remote repository. Clean that up with:
$ git remote prune origin # Deletes stale references. $ gir fetch --prune origin # Fetch (i.e. resync with origin) and prune. |
$ git branch -d -r origin/validator # Delete branch. |