Git Notes
Table of Contents
1. History
-
To review a previous commit:
-
Make a copy of the repo
-
Launch gitbash
-
CD into the copy of the repo
-
Look through the history and identify the desired
commit-hashby running:git log -
Now
checkoutthe desired version:git checkout <commit-hash>
-
2. Troubleshooting
2.1. The .gitignore file doesn’t ignore all the files
-
Try this as an example where all the file in the
node_modulesfolder are not being ignored:-
Run this
git rm -r --cached ./node_modules -
Now do a git commit which will remove all of the files in
node_modulesfolder from the list of changed files. -
At this point the list of changed files will be the intended list.
-