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
相关文章
相关标签/搜索