Git Command Shortcuts¶
Common Git Command Reminders¶
Initialized a new repo for the current folder
Clone a remote repository
Stage files for commit
Adds all the files to the stages
Commit the files with a message
Creates a version of your repo for point in time commit prior to staging
Adding a remote repo
Publishing your code to github
Creating a new local branch
To switch from different branches
Fetch remote changes
Git fetch tells git to go to the default remote repo and donwload all the changes to the local repo
Git interactive rebase allows you to reaarange, eliminate, and much more
Git reset hard if you want to start from a clean slate. Gives you a new chance to throw anything not committed away.
If you want to stash your changes and then move to another branch without losing your work
git stash <stashes uncommited changes>
git stash pop <retrieves the changes you stashed last>
git stash drop <drops the changes from your stashed list>
rename a branch if you misspelled or need to update the name
git branch -m <OldBranchName> <NewBranchName>
git push <remoteName> :<oldBranchName> <NewBranchName>
Show a commit log
Create a graph from all of the commit logs