Skip to content

Instantly share code, notes, and snippets.

@sadmansh
Last active May 22, 2018 15:54
Show Gist options
  • Save sadmansh/7865c2498059ca218ad3543d10c961bf to your computer and use it in GitHub Desktop.
Save sadmansh/7865c2498059ca218ad3543d10c961bf to your computer and use it in GitHub Desktop.
GitHub CLI commands cheatsheet
# Clone into existing directory
git init
git remote add origin PATH/TO/REPO
git fetch
git reset origin/master # this is required if files in the non-empty directory are in the repo
git checkout -t origin/master
# Add all files
git add .
# Remove files in .gitignore
git rm -r --cached .
# Commit
git commit -m "Commit message"
# Push
git push origin <branch/optional>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment