Skip to main content
Here we are using the Git Bash command line.
Paths are relative to your current directory

Get the latest updates from GitHub

Unless you are working on your fork, make it a habit to pull:
  • before you start every morning
  • frequent during the day
  • before you start a commit
Resolve any merge conflicts.
Plain git pull merges by default, which can add noisy merge commits to a feature branch if your local and remote copies have diverged. git pull --rebase replays your local commits on top instead, keeping history linear. Make it permanent with git config --global pull.rebase true.

Check local changes

See exactly what changed, not just which files:
Checking status “all the time”? Create a convenient shorthand:
The next time you can just type git st. (Don’t worry, git status will still work.)

Inspect commit log

Saving changes to your repository

  1. Tell Git what you want to save.
    • Everything in the repository, regardless of your current directory:
    • Everything in your current directory and below only, not the same as --all if you’re sitting in a subfolder:
    • A specific folder (recursive):
    • A specific file:
    If you have moved or renamed a file without using git mv, you must add both the old and the new file or folder name!
  2. Commit your saved changes to your local repository. End the message with the issue ID in parentheses: see branch strategy for why.
  3. Send your changes to GitHub.
    • If you didn’t set the upstream when you created the branch, you need to do it now:
    Git 2.37 and later can do this automatically: git config --global push.autoSetupRemote true. Set it once and you won’t need --set-upstream again.
You’ve done it! Your code is now up in your GitHub repository! Need to fix something you submitted? No problem! Just make your changes in the same branch and then commit and push again.