首页 > 其他 > 详细

演示Git使用

时间:2018-07-04 16:35:31      阅读:168      评论:0      收藏:0      [点我收藏+]

对于新建的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)

  

提交成功会显示下图:

技术分享图片

 

演示Git使用

原文:https://www.cnblogs.com/metianzing/p/9263881.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!