zoukankan      html  css  js  c++  java
  • 演示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)
    

      

    提交成功会显示下图:

  • 相关阅读:
    年薪百万必备能力
    二叉搜索树
    字符串和字符串模式匹配
    2006最后寄语
    “豆瓣”式推荐
    什么是LOMO?
    大国崛起
    马季之死
    时间的价值(The Value Of Time)
    我读雅虎的“花生酱宣言”
  • 原文地址:https://www.cnblogs.com/metianzing/p/9263881.html
Copyright © 2011-2022 走看看