25. Part 1 - Git
Using git via the command line to create a new
project and version it
26. challenge 1
Open your terminal. Using the command line, create a
new folder on your Desktop. Jump into this newly-
created folder, then create a new HTML file.The
convention is to call this file “index.html”.
How you do know the file was successfully created?
27. challenge 2
If not done already, set your identity in git. Then initialise
git inside the current folder. Make a first commit. By
convention, the commit message for the first commit is:
“initial commit”
28. challenge 3
Drag and drop the HMTL file in your text / code editor
(Sublime Text). Then write some stuff in it. Finally, save
the file! How do you review what changed in the HTML
file using git? Make a new commit to explain what
changed.
29. challenge 4
Create a new branch and jump onto that branch. How
do you know how many branches there are in the
project? How do you know which branch you are on?
30. challenge 5
Make some changes to the HTML file again. Save it!
Commit these changes onto the branch. Go back to the
master branch.
What do you notice in your HTML file?
31. challenge 6
Merge your branch onto master, then delete the branch
your previously created so that you don’t have already
used branches lagging behind.
Again, what do you notice in your HTML file?
32. challenge 7
Using terminal commands, exit your current repository
and go back to the Desktop repository.
33. Part 2 - Github
Using git along with GitHub to collaborate on
an existing project online.
34. challenge 8
Find out what your Github username is. Then write it
down in the comment section of the Meetup page of
this event (where I shared the link of these slides). Let
me know when it’s done, I’ll add you to the project on
GitHub. 🙂
35. challenge 9
Click on this link to accept my invitation to the GitHub
repository: http://bit.ly/wagonmelgit. You’re now a
collaborator of this repository and have push and pull
access.
+
36. challenge 10
Clone a copy of this repository using the HTTPS link:
http://bit.ly/gitgit1 - Then jump into that repository. For
your information, cloning a project from Github
automatically initialises git.
+
37. challenge 11
Create a new branch, then update the HTML file
according to the instructions in it and save it. Finally,
commit the changes on that branch.
+
38. challenge 12
How do you list the remote repositories linked to your
project? You need to find Github’s nickname to be able
to push your branch there. Using git, push your branch
to GitHub.
+
39. final challenge 🎉
Go to the repository page on Github:
https://github.com/twinturtle42/github_lewagonMEL
Open a Pull Request for me to review and let me know
when it’s done 🙂
+
40. congrats 😎
If your Pull Request got accepted, your changes are
added to the codebase and available online forever!
https://charlymartin.github.io/github_workshop/