====== Git Cheat Sheet ====== **NOTE**: Even as a database guy, you still should check in your scripts, etc.. A Good reference: https://education.github.com/git-cheat-sheet-education.pdf === Working in the Master Branch === If doing work in the master branch * cd * git pull origin master (NOTE: master is now main) * git add --all * git commit * git push origin master (NOTE: master is now main) === Creating a branch and merging changes === mike branch /----------------------> / \ ---O--------------------------O------------> | | branch merge * cd * git branch mike_branch * or * git checkout -b mike_branch * git status * git add . * git commit -m "some comments" * git push origin mike_branch This pushes the changes from the mike branch to upstream on github ==== Scenario ==== Git complains about a big file after you do a commit. * git rm --cached scripts/restore/bigfile.dat * rm 'scripts/restore/bigfile.dat' * git commit --amend --no-edit * git push origin master (or main) ==== Cloning a Repo ==== * cd to the directory you want to clone to * git clone https://github.com/ * git config --global user.email "your email" * git config --global user.name "first last"