Information Technology Grimoire

Version .0.0.1

IT Notes from various projects because I forget, and hopefully they help you too.

git Cheat Sheet

git status
git add .
git add this\that.file
git commit -m "this helpful"
git push
git push origin --force
git log

erases previous history

git reset --hard g0BblyG00kHash

retain history

git checkout -b new_branch 23423432
git add -A
git commit
git checkout master
git merge new_branch

another option

cd /tmp
git clone https://github.com/toby-marks/tobybase.git
cd tobybase
git checkout 85add47b28670abaf99b17e010edeafb2fbb3189
cp content/posts/*.md /path/to/tobybase/working/directory/content/posts/
cd /path/to/tobybase/working/directory
git add -A
git commit -m "Restoring files lost after 85add47b28670abaf99b17e010edeafb2fbb3189"

Usage Summary

Here is a quick reference to help you with the basics:

COMMANDDESCRIPTION
git cloneDownloads the repo to your local device
git addAdds files to the tracking list
git commitAdds all tracked files to the commit queue
git pushUploads all of the commit queue to your remote repo
git push –forceUploads all of the commit queue to your remote repo, overwriting without a merge
git pullDownloads any changed files to your local repo
git reset –hardDownloads any changed files to your local repo, ignoring your changes and simply overwriting your files
git statusShows what git knows about, what has changed
git logShows all commits and their comments