首页 > 代码库 > Command Line 5

Command Line 5

The use of github:

1.get clone command allows you to get a remote repository to your computer。

2. Every git repository consists of one or more branches. Each branch is a slightly different version of the code。

3. The main branch of a git repo is typically called master.

4. Usually programmers make different features as different branch. And then put back into the master.

5. push git pushed the commits from local repo to remoted repo.

6. We use git push origin master to push the master from local repo to the remote repo(origin). We can also use git remote to check the remote name.

7. For each commit, there is a hash(its unique identification). We can use git show hash to check the detail of each commit.

8. Use git diff to find the difference between each commit.

9. Hash changes every time we git a commit.

10. git reset can reset the repo back to the certain commit by using the certain hash.

11. git pull: update the current branch with the latest commits

12. In the git. HEAD always shows the current commit hash, then HEAD~1 HEAD~2.... Also we can use git rev-parse HEAD to check the coorespond hash of the commit.

Command Line 5