Skip to content

Instantly share code, notes, and snippets.

@laboon
Created August 11, 2021 14:36
Show Gist options
  • Save laboon/c9927364e296551516620dcdb17c9432 to your computer and use it in GitHub Desktop.
Save laboon/c9927364e296551516620dcdb17c9432 to your computer and use it in GitHub Desktop.
Some basic git commands
Git commands
# Go to master
git checkout master
# Pull from origin
git pull
# Show all branches
git branch -a
# Get current status
git status
# Generate new branch, branching off of current branch
git checkout -b laboon_test_update
what is different on this branch vs master branch
git diff master
# Add file
git add ./docs/mirror-build-build-with-polkadot.md
# Commit with message
git commit -m "fixes #2449"
# Commit all with message
git commit -am "few to several"
# Show last commits
git log
$ Go to previous branch that you were on
git checkout -
# interactive rebase
git rebase -i master
# push up to origin
git push --set-upstream origin laboon_test_update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment