DEV Community

Cover image for Github Commands.
Areeba Farooq
Areeba Farooq

Posted on

Github Commands.

When I started using git 3 years ago, I found it very confusing. It had over 100 commands that came with arguments/options.

After a while, I realized that I didn't have to learn them all to hit the ground running in most teams.

This was how I understood the commands I used often:

  • git status - where am I? what has changed?
  • git clone - copy an upstream repository into a local folder
  • git init - start tracking this folder or create a new git repository.
  • git checkout - branch away to a new or existing branch.
  • git add - prepare my most recent code changes for my next commit.
  • git commit - advance added changes to be ready for publishing.
  • git push - publish committed changes.
  • git pull - get me an updated version from upstream.
  • git merge - combine branches (local).
  • git branch - switch branches.
  • git diff - what is happening?
  • git log - what has happened?
  • git restore - undo changes

Feel free to add yours :)

Top comments (0)