Common tasks
Git is primarily a command line tool, here are a few commands that you’ll use regularly:
$ git initTo turn a folder into a Git repository$ git statusShows you what has changed in your repository$ git difftoolAllows you to visually compare the changed files$ git addAdds a file to Git and readies it for committing$ git commit -m "Your commit message."Saves the current state of your files into Git’s history$ git cloneGet a copy of a repository$ git pushSend your commits to a remote repository$ git pullGet changes from a remote repository and merge them with your local copy$ git rmDelete a file from the repository$ git checkoutMove backward and forward in history$ git branchCreate a new, different version of the repository to add a new feature
Most Git GUI tools have buttons that perform the same commands you’d execute with the Terminal.