A short guide to the Github

1. Git and Github

  1. Git operation: the operation on your computer.
  2. Github operation: the operation on the website of the Github.

2. The actions in the Githubgithub1.png

  1. Fork his repo: This is a GitHub operation, in which you are making a copy of Joe’s repository (including the files, commit history, issues, and more). This repository now lives in your GitHub account. Nothing has yet happened to your local computer.
  2. Clone your repo: This is a Git operation, in which you are using Git to tell GitHub “please send me a copy of my repo.” The repo is now stored on your local computer.
  3. Update some files: You can now make updates to the files in whatever program or environment you like.
  4. Commit your changes: This is a Git operation, in which you are telling Git to record the file changes you have made. This is an operation on your local computer only.
  5. Push your changes to your GitHub repo: This is a Git operation, in which you are using Git to tell GitHub “here are my changes.” Pushing does not happen automatically, so until you do this step, GitHub does not know about your commits.
  6. Send a pull request to Joe: If you think that Joe might like to incorporate your changes, you send him a pull request. This is a GitHub operation, in which you are communicating your changes to Joe, and “requesting” that he “pull” from your repo. It is up to him whether he pulls from you or not.

3.Syncing a fork

if the repo which you have forked, has been changed by the owner or others. You must “sync the fork”. So that you can change or edit the files under the latest repo.

github2.png

  1. Fetch changes from Joe’s repo: This is a Git operation, in which you are using Git to tell GitHub that you would like to retrieve the latest files from Joe’s repo.
  2. Merge those changes into your repo: This is a Git operation, in which you are updating the repo on your local computer with those changes (which have been temporarily stored in a “branch”). Note: Steps 1 and 2 are often combined into a single Git operation called a “pull.”
  3. Push the updates to your GitHub repo (optional): Remember that your local computer does not automatically update your GitHub repo. Therefore, the only way to get your GitHub repo up-to-date is by pushing up the latest changes. You can either do this right away, or you can wait until you have made some updates of your own and committed them locally.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.