FETCH HEAD is  b9de600

FETCH HEAD is b9de600

Completely reset to a specific branch

git fetch origin master
git reset --hard FETCH_HEAD
git clean -f -d

Note: FETCH_HEAD can be found on github.com

If you’re in “# HEAD detached at 8b4ff32” state:

git checkout master
git pull

Remove all files of a specific type:

Note: Use bash

find . -name "*.pyc" -exec git rm {} \;


quickCapture.png

Nuclear Option

“FML - I have no idea what the hell is wrong with my repository“ - Fei

Use these steps ONLY if you DO NOT NEED anything from your local repository

  • Delete the entire folder

  • git clone <URL>

You can get the URL from https://github.com - click on the green “clone” button on the repository


Get rig of files that were added before .gitignore

  • Make sure everything is checked in, including any changes to .gitignore

  • git rm -r --cached .

  • git add .

  • git commit . -m “Cleaning repo”


Create a new branch from your current work

git checkout -b some_new_branch