· Public Notes  · 1 min read

git

A cheat sheet for basic Git commands and concepts.

A cheat sheet for basic Git commands and concepts.

Basic Commands

  • git init - Initialize a new Git repository

  • git clone <url> - Clone a repository

  • git status - Show the working directory status

  • git add <file> - Add a file to the staging area

  • git commit -m “message” - Commit changes

  • git push - Push changes to the remote repository

  • git pull - Pull changes from the remote repository

Branching

  • git branch - List branches

  • git branch <name> - Create a new branch

  • git checkout <name> - Switch to a branch

  • git checkout -b <name> - Create & Switch to a new branch

  • git merge <name> - Merge a branch into the current branch

  • git branch -d <name> - Delete a branch

Remote Repositories

  • git clone <url> - Clone a repository

  • git pull - Pull changes from the remote repository

  • git push - Push changes to the remote repository

Stashing

  • git stash - Stash changes

  • git stash list - List stashes

  • git stash apply - Apply a stash

  • git stash drop - Drop a stash

    Share:
    Back to Blog

    Related Posts

    View All Posts »
    Biking from Osnabrück to Berlin

    Biking from Osnabrück to Berlin

    Taking a look back on a four-day, nearly 800 km bikepacking adventure from Osnabrück to Berlin and back, including a side trip to Poland, highlights, challenges, and lessons