Git Cheatsheet
Git Cheatsheet
This is a cheatsheet of the most commonly used Git commands.
- Configuring Git:
1 2
git config --global user.name "Example" git config --global user.email example@example.com
- Initializing a repo and adding remote origin.
1 2 3
git init - innitializes empty git repo in current directory git remote add origin git@github.com:ArcticTechnology/sandbox.git git branch -M main
- Check the status of untracked files.
1
git status
- Adding files to repo and committing changes.
1 2
git add . git commit -m "My Commit Message"
- Push files to Github.
1
git push
- Pulling files from Github
1
git pull
- Forking projects from Github
1
git clone
- Fixing up a commit, for combining multiple commits into one.
1
git rebase -i
- Resetting a commit, if you want to redo a commit that you havent pushed yet.
1
git reset @~
This post is licensed under CC BY 4.0 by the author.