This workshop must be done in pairs, each participant must choose a role:
- Simon
- Garfunkel
Simon creates a folder locally on his computer, named git-local
and opens the folder.
Once in the folder, Simon initiates a new git repository.
Garfunkel watches what Simon does and checks that it doesn't break anything!
Simon creates a new empty file named README.md
.
Simon adds this file to the staging area and then commits it with the message "Repository initialization".
Garfunkel helps Simon and makes him do the git status
command between each step and the git log
command at the end.
Garfunkel creates a public repository on GitHub, called git-workshop
: he must not check "Add a README file", "Add .gitignore" and "Choose a license".
Once the repository is created, Garfunkel goes to the "Settings" and "Manage access" tab and adds Simon to his repository with the "Invite a collaborator" link.
Simon makes sure that Garfunkel doesn't check any box and scold him if necessary. Then Simon will check his emails and accepts the invitation.
Garfunkel sends the address of the deposit thus created to Simon. The address should look like : https://github.com/**Garfunkel**/git-workshop.git
.
Simon retrieves the address of the repository and links its local repository with the remote repository with the git remote add origin https://github.com...
command.
Simon now has its local repository linked to the remote repository! So he can push his first commit to GitHub with the git push origin main
command.
Garfunkel refreshes the GitHub page of the repository to check that the README.md
file has appeared.
Garfunkel will modify the contents of the README.md
file from GitHub. He can add whatever he wants, especially if it's a joke at the expense of Simon.
Simon, curious to get the new version of the README.md
file, will pull the remote repository to its local repository with the git pull origin main
command. He will then issue the git log
command and display the contents of the file to check that it has been updated.
Simon and Garfunkel exchange their roles and redo the workshop from the beginning!