github項目初始化命令解讀

…or create a new repository on the command line

echo "# springbootstarterhello" >> README.md
  git init
  git add README.md
  git commit -m "first commit"
  git remote add origin https://github.com/leonardocsc/springbootstarterhello.git
  git push -u origin master
  • echo "# springbootstarterhello" >> README.md 新建README.md文件並輸入springbootstarterhello。git

  • git init 本地項目初始化github

  • git add README.md 添加README.md文件到暫存區(Index)spring

  • git commit -m "first commit" 將文件提交到本地HEAD。springboot

  • git remote add origin https://github.com/leonardocsc/springbootstarterhello.git 將本地項目關聯到遠程項目。code

  • git push -u origin master 若是當前分支與多個主機存在追蹤關係,則能夠使用-u選項指定一個默認主機,這樣後面就能夠不加任何參數使用Git push。rem

or push an existing repository from the command line

git remote add origin https://github.com/leonardocsc/springbootstarterhello.git
git push -u origin master
相關文章
相關標籤/搜索