Being able to use both, git and GitHub, is an important skill every software/data engineer must possess. This is even more important when it comes to the ability to handle codes in collaborative projects. This lab will help you learn how to use git/GitHub and understand its importance.
-
First of all, install git if you don't have it yet, and create a GitHub account. ( You can refer to the lesson "Install Git and Create GitHub Account" in the prework. Follow the guidelines given there. Additionally, you can use these resources: Install git, Version control with git)
-
Create a new repository in the GitHub. Name it
Iron
+ your name. Example: if your name is Alvaro, you will name the repoIronAlvaro
. -
Clone that repo to your computer.
-
Create a file in that folder. Name it
about.txt
and add a fun fact about yourself. (You can use the command line:touch nameOfTheFile.txt
). -
Add the file you just created to the git.
-
Commit the changes.
-
Push the changes to the GitHub and check your repository to make sure everything is there.
Great! This was pretty smooth, we hope. 🚀
Now let's practice the collaboration part.
Pair yourself with a classmate. Send the link of your GitHub repository to your pair via Slack. Now each of you should perform the following set of actions:
- Fork your classmate's repository.
- Clone the repository, so that you have it locally and can make changes.
- Create a new branch named
classmate
. - Create a new file with your name (ex.
maya.txt
) and finish the following sentence I enrolled Ironhack's Data Analytics bootcamp because.... When you are done, save the changes. - Add the changes to the git.
- Commit and push the changes. Now, all the changes should be on your GitHub, inside the forked repository.
- Create a pull request to make changes appear in the original repository.
- Merge the branch your classmate created. Now everyone's repos should have the original file (
about.txt
) as well as the new one with your classmate's name.
We hope you enjoyed this activity and learned something new about your classmates! ❤️