Skip to content

Instantly share code, notes, and snippets.

@iJKTen

iJKTen/Git Commands

Last active May 7, 2021
Embed
What would you like to do?
# Add everything to be commited
git add .
# Commit all the changes
git commit -m "message"
# Add everything and commit in one line
git commit -am "message"
# Create a new branch from main
git checkout -b branch-name
# Merge back to main
git checkout main
git merge branch-name
# Delete a branch
git branch -d branch-name
# Check the status of git
git status
# Check git log
git log
# If you need to make a change and have that change be present in the last commit and the repo is not pushed to public
# Make your change
git add .
git commit --amend --no-edit
# If you need to change a spelling mistake in your last commit
git commit --amend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment