[Git/GitHub] Tutorial 1. Git download and commit first project
Posted johnsonxiong
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Git/GitHub] Tutorial 1. Git download and commit first project相关的知识,希望对你有一定的参考价值。
1. Install at https://git-scm.com/downloads
2. Set up your name and email
$ git config --global user.name "Johnsonxiong"
$ git config --global user.email "[email protected]"
3. Confirm 2nd step is done
$ git config —-list
4. Create a folder at local computer “GitHub-tutorial”
5. Open terminal and change path into the folder created last step
$ cd /Users/johnsonxiong/Documents/GitHub/GitHub-tutorial
6. Initialized empty Git repository
$ git init
7. Create a GitHub_SpoolUp.txt into the “GitHub-tutorial” folder.
8. Add the GitHub_SpoolUp.txt into the middle stage.
$ git add GitHub_SpoolUp.txt
9. Commit the change and write comments in the repository.
$ git commit -m "add a tutorial read file"
10. Check the status of the project. Will be red if not add into the middle stage yet.
Will be green if add into the middle stage.
$ git status
11. Commit all the change from the local and stage in the repository. (-am means -a -m)
Actually it is add local to stage first, and then commit files in the stage to repository.
$ git commit -am "change the license file"
以上是关于[Git/GitHub] Tutorial 1. Git download and commit first project的主要内容,如果未能解决你的问题,请参考以下文章