Banner: ZumGuy Publications and Network

ZumGuy Publications and Network

Git cheat sheet

Posted by Sean on Friday, 22nd September 2017 16:09
Here are the git commands I most frequently use, along with a brief description of what they are used for.

  • git init
    : create a new repository of the current directory.

  • ls -a
    : list all the items in the current directory.
    shows hidden items aswell (like the

  • git status
    : show the current status of the git repository, along with staged and untracked files.

  • git add <filename>
    : add to the staging area (files to be committed).
    git add .
    will add all untracked files.

  • git commit
    : commit staged files to the repository.

  • git log
    : show a list of all the past commits.

  • git fetch
    : sync with the remote server, getting information about remote commits but not downloading any data.

  • git pull
    : update the repository by downloading updates from a remote source.
    may be necessary.

  • git push
    : update the repository on the remote server by upoading commits made on this machine.

  • git clone <repo>
    : download a new repository from the remote server.

  • git show --stat <commit_hash>
    : show which files have been changed in the specified commit, in a similar format to when a commit is made. If you don't specify a commit hash, the latest commit will be shown.

  • git show <commit_hash>
    : shows all the changes that happened in each file for the specified commit. If you don't specify a commit hash, the latest commit will be shown.

Posted by Andrew on Sunday, 24th September 2017 08:31

Good for the records. Thanks!

You must be logged in to post messages.

Quote of the day...

ZumGuy Internet Promotions