Skip to content

Instantly share code, notes, and snippets.

@IamFaizanKhalid
Created February 12, 2020 12:39
Show Gist options
  • Save IamFaizanKhalid/6de08e924e58f5bd2e9413c55cdbe738 to your computer and use it in GitHub Desktop.
Save IamFaizanKhalid/6de08e924e58f5bd2e9413c55cdbe738 to your computer and use it in GitHub Desktop.
Markdown file containing git related commands..

Git Commands

  • Initialize an empty repository

    $git init
  • Add files to staging area

    $git add filename.ext
  • Check changings status

    $git status
  • Commiting changes

    $git commit -m "Customized Message"
  • View commits history

    $git log
  • Adding remote origin

    $git remote add origin https:/site.com/user/repo.git
  • Remove remote origin

    $git remote remove origin
  • Pushing master branch to remote repository

    $git push origin master
  • Clone a remote repository

    $git clone https:/site.com/user/repo.git
  • Switch to another branch

    $git checkout OtherBranch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment