1. 程式人生 > >[Git/GitHub] Tutorial 1. Git download and commit first project

[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"