Skip to content

faq0/intro-to-github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

11 Commits

Repository files navigation

Introduction to GitHub

Get started using GitHub in less than an hour.

People use GitHub to build some of the most advanced technologies in the world. Whether you’re visualizing data or building a new game, there’s a whole community and set of tools on GitHub that can help you do it even better. GitHub Skills’ “Introduction to GitHub” course guides you through everything you need to start contributing in less than an hour.

  • Who is this for:New developers, new GitHub users, and students.
  • What you'll learn:We'll introduce repositories, branches, commits, and pull requests.
  • What you'll build:We'll make a short Markdown file you can use as yourprofile README.
  • Prerequisites:None. This course is a great introduction for your first day on GitHub.
  • How long:This course is four steps long and takes less than one hour to complete.

How to start this course

Follow the step-by-step instructions below.

Step 1: Create a branch

Welcome to "Introduction to GitHub"! 👋

What is GitHub?:GitHub is a collaboration platform that usesGitfor versioning. GitHub is a popular place to share and contribute toopen-sourcesoftware.
📺Video: What is GitHub?

What is a repository?:Arepositoryis a project containing files and folders. A repository tracks versions of files and folders.

What is a branch?:Abranchis a parallel version of your repository. By default, your repository has one branch namedmainand it is considered to be the definitive branch. You can create additional branches off ofmainin your repository. You can use branches to have different versions of a project at one time.

On additional branches, you can make edits without impacting themainversion. Branches allow you to separate your work from themainbranch. In other words, everyone's work is safe while you contribute.

What is a profile README?:Aprofile READMEis essentially an "About me" section on your GitHub profile where you can share information about yourself with the community on GitHub.com. GitHub shows your profile README at the top of your profile page.

⌨️ Activity: Your first branch

  1. Open a new browser tab, and navigate to this same repository. Then, work on the steps in your second tab while you read the instructions in this tab.
  2. Navigate to theCodetab.
  3. Click on themainbranch drop-down.
    image showing my-first-branch entry
  4. In the field, enter a name for your branch:my-first-branch.
  5. ClickCreate branch: my-first-branchto create your branch.
  6. Move on to Step 2!
    Note:If you want to confirm you correctly set up your first branch, wait about 20 seconds then refresh this page.GitHub Actionswill automatically close this step and open the next one.

Step 2: Commit a file

You created a branch! 🎉

Creating a branch allows you to edit to your project without changing themainbranch. Now that you have a branch, it’s time to create a file and make your first commit!

What is a commit?:Acommitis a set of changes to the files and folders in your project. A commit exists in a branch.

⌨️ Activity: Your first commit

The following steps will guide you through the process of committing a change on GitHub. Committing a change requires first adding a new file to your new branch.

  1. On theCodetab, make sure you're on your new branchmy-first-branch.
  2. Select theAdd filedrop-down and clickCreate new file.
    create new file option
  3. In theName your file...field, enterPROFILE.md.
  4. In theEdit new filearea, copy the following content to your file:
    Welcome to my GitHub profile!
    
    profile.md file screenshot
  5. For commits, you can enter a short commit message that describes what you changes you made. This message helps others know what's included in your commit. GitHub offers a simple default message, but let's change it slightly for practice. First, enterAdd PROFILE.mdin the first text-entry field belowCommit new file.Then, if you want to confirm what your screen should look like, expand the dropdown below.
    Expand to see the screenshot. screenshot of adding a new file with a commit message
  6. In this lesson, we'll ignore the other fields and clickCommit new file.
  7. Move on to Step 3!
    Note:Like before, you can wait about 20 seconds, then refresh this page andGitHub Actionswill automatically close this step and open the next one.

Step 3: Open a pull request

Nice work making that commit ✨

Now that you’ve created a commit, it’s time to share your proposed change through a pull request!

What is a pull request?:Collaboration happens on a pull request. The pull request shows the changes in your branch to other people. This pull request is going to keep the changes you just made on your branch and propose applying them to themainbranch.
📺Video: Introduction to pull requests

⌨️ Activity: Create a pull request

You may have noticed after your commit that a message displayed indicating your recent push to your branch and providing a button that saysCompare & pull request.

screenshot of message and button

If you want, feel free to clickCompare & pull request,and then skip to step 6 below. If you don't click the button, the instructions below walk you through manually setting up the pull request.

  1. Click on thePull requeststab in your repository.
  2. ClickNew pull request.
  3. In thebase:dropdown, make suremainis selected.
  4. Select thecompare:dropdown, and clickmy-first-branch.
    screenshot showing both branch selections
  5. ClickCreate pull request.
  6. Enter a title for your pull request:Add my first file.
  7. The next field helps you provide a description of the changes you made. Feel free to add a description of what you’ve accomplished so far. As a reminder, you have: created a branch, created a file and made a commit!
    screenshot showing pull request
  8. ClickCreate pull request.
  9. Move on to Step 4!
    Note:Like before, you can wait about 20 seconds, then refresh this page andGitHub Actionswill automatically close this step and open the next one. As a perk, you may see evidence of GitHub Actions running on the tab with the pull request opened! The image below shows a line you might see on your pull request after the Action finishes running.
    screenshot of an example of an actions line

Step 4: Merge your pull request

Nicely done friend! 😎

You successfully created a pull request. You can now merge your pull request.

What is amerge:Amergeadds the changes in your pull request and branch into themainbranch.
📺Video: Understanding the GitHub flow

As noted in the previous step, you may have seen evidence of an action running which automatically progresses your instructions to the next step. You'll have to wait for it to finish before you can merge your pull request. It will be ready when the merge pull request button is green.

screenshot of green merge pull request button

⌨️ Activity: Merge the pull request

  1. ClickMerge pull request.
  2. ClickConfirm merge.
  3. Once your branch has been merged, you don't need it anymore. To delete this branch, clickDelete branch.
    screenshot showing delete branch button
  4. Check out theFinishstep to see what you can learn next!
    Note:Like before, you can wait about 20 seconds, then refresh this page andGitHub Actionswill automatically close this step and open the next one.

Finish

Congratulations friend, you've completed this course and joined the world of developers!

celebrate

Here's a recap of your accomplishments:

  • You learned about GitHub, repositories, branches, commits, and pull requests.
  • You created a branch, a commit, and a pull request.
  • You merged a pull request.
  • You made your first contribution! 🎉

What's next?

If you'd like to make a profile README, use the simplified instructions below or follow the instructions in theManaging your profile READMEarticle.

  1. Make a new public repository with a name that matches your GitHub username.
  2. Create a file namedREADME.mdin it's root. The "root" means not inside any folder in your repository.
  3. Edit the contents of theREADME.mdfile.
  4. If you created a new branch for your file, open and merge a pull request on your branch.
  5. We'd love to see your new profile! Share your profile on social media and tag us!
  6. Lastly, we'd love to hear what you thought of this coursein our discussion board.

Check out these resources to learn more or get involved:


Get help:Post in our discussion boardReview the GitHub status page

© 2022 GitHub •Code of ConductCC-BY-4.0 License

About

Introduction to Github - Github Classroom

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published