Skip to content

Instantly share code, notes, and snippets.

@akmamun
Created January 5, 2020 19:01
Show Gist options
  • Save akmamun/a7ba020d2f9542e52f7fa3259da8eef7 to your computer and use it in GitHub Desktop.
Save akmamun/a7ba020d2f9542e52f7fa3259da8eef7 to your computer and use it in GitHub Desktop.
Git Essential

Git Essential

Git initialization

  • Only one time need to initialization
git init

Git add

  • Add single file or folder or all changes made
git add filename 
  • Add a folder git add folder_name
  • Add all file git add .

Git commit

  • Commit message should be meaningful sentence
git commit -m "commit message"
  • Want to commit all changes git commit -am "commit message"

Git remote

  • Add a remote git remote add origin repository URL
  • See Current remote URL or Verify new remote URL git remote -v
  • Change Current remote URL git remote set-url origin repository URL

Git push

  • Push Changes into remote URL
git push

Git clone

git clone repository
  • Git clone with customize folder name git clone repository folder_name

Git pull

git pull
  • Git pull with a branch name git pull origin name

Git checkout

  • Reset all previous git pull code git checkout .
  • Checkout a single file or folder git checkout file_name or git checkout folder
  • Change a branch git checkout branch_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment