Python basics
  • Tutorial
  • Exercices
  • About
  1. Git
  2. Git exercices
  • Introduction
    • Python
  • Fundamentals
    • 0-Basic Syntax
    • 1-Variables
    • 2-Data types
    • 3-Numbers
    • 4-Strings
    • 5-Lists
    • 6-Booleans
    • 7-Loops
    • 8-Functions
    • 9-Dictionary
  • Advanced
    • 10-Numpy
    • 11-Matplotlib
    • 12-DataFrame
  • CLI
    • Exercices
    • Solutions
  • Git
    • Git introduction
    • Git branch
    • Git exercices
  • SQL
    • SQL Exercices
    • SQL Solutions

On this page

  • Github
  • Exercice 1
  • Exercice 2
  • Exercice 3
  1. Git
  2. Git exercices

Git exercices

Github

  • Go to this website and try to follow the tutorial: Github Tutorial

  • You can also look at the documentation in this link

Exercice 1

  1. Create a branch dev and dev-fix. Create a file named index.html in dev-fix, commit it. Merge dev with dev-fix and delete dev-fix

  2. Push the dev branch in Github.

  3. Modify the index.html with the user interface.

  4. Pull the branch in command line.

  5. Add a new line in the index.html file. Commit it.

  6. Modify the file and commit with the git commit --amend --no-edit command to prevent the add of a new commit.

  7. Push the file in Github.

  8. Merge the branch dev in main and delete the dev branch in both Github and local environment.

Exercice 2

Reproduce this schema (master replaced by main):

Exercice 3

Reproduce this schema (with branch1 and branch2 as name for the two different branches):

Note

You can use the git log --graph --oneline --all command to see the tree of commits.

Git branch
SQL Exercices
 

Copyright 2023, Clément Bernard