演示Git使用
对于新建的repository,第一次提交,完整过程:
13643@DESKTOP-K6CS6SE MINGW64 ~/Desktop/555
$ ls
Readme.md run.py
13643@DESKTOP-K6CS6SE MINGW64 ~/Desktop/555
$ git init
Initialized empty Git repository in C:/Users/13643/Desktop/555/.git/
13643@DESKTOP-K6CS6SE MINGW64 ~/Desktop/555 (master)
$ git remote add origin https://github.com/shiyi000/test_forgit.git
13643@DESKTOP-K6CS6SE MINGW64 ~/Desktop/555 (master)
$ git status
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
Readme.md
run.py
nothing added to commit but untracked files present (use "git add" to track)
13643@DESKTOP-K6CS6SE MINGW64 ~/Desktop/555 (master)
$ git add .
13643@DESKTOP-K6CS6SE MINGW64 ~/Desktop/555 (master)
$ git commit -m 'first commit'
[master (root-commit) b0e1438] first commit
2 files changed, 5 insertions(+)
create mode 100644 Readme.md
create mode 100644 run.py
13643@DESKTOP-K6CS6SE MINGW64 ~/Desktop/555 (master)
$ git status
On branch master
nothing to commit, working tree clean
13643@DESKTOP-K6CS6SE MINGW64 ~/Desktop/555 (master)
$ git push -u origin master
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 413 bytes | 413.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
To https://github.com/shiyi000/test_forgit.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
13643@DESKTOP-K6CS6SE MINGW64 ~/Desktop/555 (master)
提交成功会显示下图:


浙公网安备 33010602011771号