git learning



1. Glossary


Clone

A clone is a copy of a repository that lives on your computer instead of on a website's server somewhere, or the act of making that copy. With your clone you can edit the files in your preferred editor and use Git to keep track of your changes without having to be online. It is, however, connected to the remote version so that changes can be synced between the two. You can push your local changes to the remoteto keep them synced when you're online.

Commit

A commit, or "revision", is an individual change to a file (or set of files). It's like when you save a file,except with Git, every time you save it creates a unique ID (a.k.a.the "SHA" or "hash") that allows you to keep record of what changes were made when and by who. Commits usually contain a commit message which is a brief description of what changes were made.

Fork

A fork is a personal copy of another user's repository that lives on your account. Forks allow you to freely make changes to a project without affecting the original. Forks remain attached to the original, allowing you to submit a pull request to the original's author to update with your changes. You can also keep your fork up to date by pulling in updates from the original.

Pull

Pull refers to when you are fetching in changes and merging them. For instance, if someone has edited the remote file you're both working on, you'll want to pull in those changes to your local copy so that it's up to date.

Push

Pushing refers to sending your committed changes to a remote repository such as GitHub.com. For instance, if you change something locally, you'd want to then push those changes so that others may access them.

Remote

This is the version of something that is hosted on a server, most likely GitHub.com. It can be connected to local clones so that changes can be synced.

Repository

A repository is the most basic element of GitHub. They're easiest to imagine as a project's folder. A repository contains all of the project files (including documentation), and stores each file's revision history. Repositories can have multiple collaborators and can be either public or private.

Upstream

When talking about a branch or a fork, the primary branch on the original repository is often referred to as the "upstream",since that is the main place that other changes will come in from.The branch/fork you are working on is then called the "downstream".



2. Command

git-clone - Clone a repository into a new directory

usage: git clone [options] [--] <repo> [<dir>]

git-checkout - Checkout a branch or paths to the working tree

usage: git checkout [options] <branch>

or: git checkout [options] [<branch>] -- <file>...


git-pull - Fetch from and merge with another repository or alocal

branch


git-add - Add file contents to the index

usage: git add [options] [--] <filepattern>...


git-commit - Record changes to the repository

usage: git commit [options] [--] <filepattern>...

Commit message options

    -m, --message <message> commit message

Commit contents options

     -a, --all commit all changed files


git-push - Update remote refs along with associated objects



3. Reference:

https://help.github.com/articles/github-glossary/



發佈了140 篇原創文章 · 獲贊 18 · 訪問量 79萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章