Cheatsheet - Git
Official Github Cheatsheet Git-tower Cheatsheet
Create
git clone <repo-clone-url>
: Clone an existing repository into your current directorygit init
: Create a new local repository
Local Changes
git status
: Show changed filesgit diff
: Show differences between modified files and the originalgit add .
: Add all current changes to the next commitgit commit -m "<change message>"
: Commit added files with a message
Update and Publish
git push origin master
: Push themaster
branch to yourorigin
remote repositorygit push <remote> <branch>
: Push the specified branch to the specified remote
Global Configs
git config --global user.name "John Doe"
: Configure the name associated with commits from your computergit config --global user.email johndoe@example.com
:Configure the email associated with commits from your computer