1. Git and Github
- Git operation: the operation on your computer.
- Github operation: the operation on the website of the Github.
2. The actions in the Github
- 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.
- 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.
- Update some files: You can now make updates to the files in whatever program or environment you like.
- 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.
- 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.
- 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.
- 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.
- 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.”
- 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.