Some Git comments I need to remember

To remove a directory from the repo ( not deleting the directory on the local file system)

  • Add path to the .gitignore file
  • git rm -r –cached path_to_your_folder/
  • push the changes to remote

To stash stuff

  • git stash

To retrieve stuff from the stash

  • git stash pop

To restore a single file from a different branch (f.i Master)

git restore --source master-- app.js

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.