Skip to content

Instantly share code, notes, and snippets.

@bastienapp
Last active March 1, 2022 14:33
Show Gist options
  • Save bastienapp/e8957bd221fe90523ff5cced921a61e1 to your computer and use it in GitHub Desktop.
Save bastienapp/e8957bd221fe90523ff5cced921a61e1 to your computer and use it in GitHub Desktop.
Git & GitHub Workshop

Git & GitHub workshop

This workshop must be done in pairs, each participant must choose a role:

  • Simon
  • Garfunkel

Step 1

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!

Step 2

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.

Step 3

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.

Step 4

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.

Step 5

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.

Step 6

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.

Last step

Simon and Garfunkel exchange their roles and redo the workshop from the beginning!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment