GitHub is one of the most popular and important development tools you will use. It keeps a history of your development activity and can be used as a tool to show potential employers your code and coding habits.
GitHub can also be used to help multiple developers work on the same code set without overwriting each other’s additions. However, this task will focus on using the tool as an individual. In this task you will use GitHub to:
Remember that Git and GitHub are two different things. Just like Gmail is one of many providers of email. GitHub is one of many providers for storing Git repositories.
Git and GitHub can be hard at first. And if you have never used the Command Line, it can be a bit intimidating. However, it might be the most important and widely used development tool.
In this class we will use Git through the command line. Start by following the Getting Started - Git Installation. Once you’re done run the following command in your Terminal (Mac/Linux) or Git Bash (Windows) to confirm it has been installed:
git --version
We will also use the GitHub Command Line Interface (CLI) Tool. Please download and install the proper version. Once you’re done, run the following command in your Terminal (Mac/Linux) or Git Bash (Windows) to confirm it has been installed:
gh --version
Once you have the GitHub CLI installed, use it to login to your GitHub account:
Run the following command:
gh auth login
GitHub.com
.HTTPS
.Y
to authenticate Git with your GitHub credentials.Login with a web browser
.ENTER
.Enter the eight digit code from the Terminal into the browser and then click Authorize github
.
Confirm you are logged in by checking the local configuration settings:
git config -l
When using Git and GitHub as an individual, you will usually follow these steps:
Clone the repo to you computer:
git clone https://github.com/BrickMMO/tasks.git
You can find the URL of a GitHub repo here:
Add current changes to the main copy:
git add .
Commit changes to the main copy:
git commit -am "Describe latest changes"
Push the changes to your GitHub repo:
git push origin main
When you are working as an individual, you will not need to create any additional branches. You can simply add and commit all your changes directly to the main
branch like in the examples above.
You can get detailed instructions of this process on my github-demo-branching repo.
Use Git and GitHub as much as possible! It will force you to practice the skill, you will have a backup of all your work, and your GitHub contributions chart will start turning green!
I would recommend the following:
Be consistent! As a developer you should be obsessed with C\consistency!
logo-github.png
. Not IMG-20170407-WA0007_resized.jpg
, IMG-20170407-WA0007.jpg
, or Copy of IMG-20170407-WA0007.jpg
.Organize your files into classes, and weeks, and topics:
http5111
│ README.md
│
└── week1
│ │ headings.html
│ │ paragraphs.html
│
└── week2
│ images.html
│ tables.html
└── images
│ logo.jpg
I have written a set of rules for myself (and all BrickMMO development) to follow when working with GitHub repos and README.md files. These rules are called _readme. You can use these as a starting point.
To complete this task, follow these steps:
Submit your class GitHub repo URLs to the Individuals assignment in Blackboard.