git 常用命令

  1. git init
    init local repository

  2. echo "#your_repository_name" > README.MD
    write "#your_repository_name" into README.MD , create README.MD at the same time

  3. git add README.MD
    add README.MD to a local repository

  4. git add .
    add all files to a local repository

  5. git commit -m "a commit message"
    make a commit message to describe your modification, and commit the change you made.

after (5), you can create remote repo in github/gitee , in order to get a for (6)

  1. git remote add main <url>
    link the local repo to remote repo, the should replaced by http links

  2. git push -u origin master
    push and merge your local repo to remote repo

  3. git commit --amend
    if you change the code after commit, but do not want make any further commits for just few changes, use this command to update the commit

posted @ 2021-08-26 15:51  小陈同学爱编程  阅读(31)  评论(0)    收藏  举报