创建新repository

repository是指你当前文件夹下没有.git文件夹的情况:

将当前文件夹下的所有文件一起提交到git仓库,记得将地址改为您的仓库地址

$ git init
$ git add -A
$ git commit -m “项目初始化”
$ git branch -M master
$ git remote add origin git@github.com:your_username/repository.git
$ git push -u origin master

$ git init
$ git add -A
$ git commit -m “项目初始化”
$ git branch -M master
$ git remote add origin https://github.com/your_username/repository.git
$ git push -u origin master

推到已有repository

$ git remote add origin git@github.com:your_username/repository.git
$ git branch -M master
$ git push -u origin master

$ git remote add origin https://github.com/your_username/repository.git
$ git branch -M master
$ git push -u origin master