Lab for coursera projects
Lab: GitHub Sign Up and Create Repo Estimated time: 30 minutes In this lab, you will get started with GitHub by creating a GitHub account and creating a new repository. You will then add a file to the repository using the GitHub web interface. Objectives After completing this lab, you will be able to:
-
Describe GitHub
-
Create a GitHub account
-
Add a project/repository
-
Create and edit a file
-
Upload and commit a file GitHub overview Before we learn to use GitHub, let's first review Git. Git is an open-source command-line-based version-control system for software development. While Git is a command-line tool and you also need to host and maintain a server on which you can use Git for versioning. GitHub is a repository hosting service that uses Git. GitHub provides a web-based hosting service with a graphical user interface(GUI) and git command line interface (CLI). It also provides access control and several collaboration features, such as wikis and basic task management tools, for every project. GitHub provides cloud storage for source code, supports all popular programming languages, and streamlines the iteration process. GitHub includes a free plan for individual developers and for hosting open-source projects.
-
Creating a GitHub account To create an account in GitHub, complete the following steps:
-
Go to the Join GitHub page and create an account. Note: If you already have a GitHub account, log in now.
-
Provide the necessary details to create an account as shown below:
-
Verify the account, and then click Submit.
-
When you have finished, click Create account.
-
You will receive a verification email from GitHub. Click the enclosed link to verify your email or enter the provided verification code. Note: If you do not receive a verification email, click Resend the code.
-
After entering the provided verification code, you will see a screen that looks like this. This indicates that you are logged into your account and you are ready to start using it.
2: Add a project/repository To add a new repository, complete the following steps:
-
At the top right of the GitHub home page, click on the "+" icon and select New repository.
-
Enter a repository name and select the Add a README file check box under the Initialize this repository with: option.
-
Click Create repository.
-
The repository is created and its home page is displayed.
Next, you'll start editing the repository. 3: Create and edit a file 3.1 Edit a file Although you will normally create a file before you edit it, in this case, the README.md file has already been created for you. To edit that file, complete the following steps:
-
Your repository root folder contains just one file: README.md. Click the pencil icon at the right to edit the file.
-
Add "It's a markdown file in this repository" text to the file and go to top right and click Commit changes
-
Add some additional description and click Commit changes.
-
Confirm that the text you added to the file has been saved.
3.2 Create a new file
-
Click on the repository name to go back to the main branch, similar to this repository called testrepo.
-
Click Add file and select Create new file to create a new file in the repository.
-
Enter a file name and extension; for example, firstpython.py. Add the lines of code displayed in the following image to your file:
-
Scroll to the top right of the page and click Commit changes.You can optionally add a description of your update (for example, “Adding a new file”). Click Commit changes to create your new file.
-
Your file is now added to your repository and the repository listing shows when the file was added or last revised.
-
Upload and commit a file To upload a local file and commit it to your repository, complete the following steps:
-
On your repository page, click Add file and then select Upload files to upload a file.
-
Click choose your files and choose a file from your computer. You can upload any file (for example, a .txt, .ipynb, or .png file) to the repository.
-
When the file finishes uploading, click Commit changes.
-
Your file is uploaded to the repository.
Summary Congratulations! In this lab, you have learned how to create a new repository, add a new file, edit a file, upload a file, and commit your changes. We encourage you to continue to update your repository to become familiar with the processes that you have learned.
