Skip to content

Git basics

Git is a way to historize your code whenever you work collaboratively on code. If you want a complete GIT guide you can download the Git Book:

Pro GIT book

Git main command

Git branch

Git branches are effectively a pointer to a snapshot of your changes. When you want to add a new feature or fix a bug—no matter how big or how small—you spawn a new branch to encapsulate your changes.

Create a new branch "develop"
git branch develop
Stage or discard modified files
# Stage all files
git add .
# Discard all files
git stash
Commit changes with a Commit Message
git commit -m "Your commit message"
Push your commit to the remote Branch
git push
Retrieve modification
git pull

Summary of the GitHub Desktop guide:

  • Create a branch
  • Stage changes
  • Discard changes
  • Commit changes
  • Push changes

GitHub Desktop - Create a branch

Summary of the Visual Studio Code Guide

  • Create a branch

GitHub - Create a branch

  • Make and Push a commit

GitHub - Edit file, commit, pull request

Summary of the Visual Studio Code Guide

  • Create a branch

VS Code - Create a branch

  • Make a commit

VS Code - Make a commit

  • Push commit

VS Code - Push commit