create a new repository on the command line
echo "# moses-boot-jasper" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/glory2018/moses-boot-jasper.git
git push -u origin master
push an existing repository from the command line
git remote add origin https://github.com/glory2018/moses-boot-jasper.git
git push -u origin master
创建项目
得到一个github地址,如https://github.com/glory2018/moses-boot-jasper.git
git init
把moses-boot-jasper变成git可以管理的仓库
忽略文件.gitignore,内容格式如:node_modules/,创建命令touch .gitignore
git add .
添加所有文件到暂存区
git commit -m "first commit"
文件提交到仓库
git remote add origin https://github.com/glory2018/moses-boot-jasper.git
关联远程仓库
git pull --rebase origin master
获取远程库与本地同步
git push -u origin master
推送本地内容到远程库
macOS配置Git账号信息
git config --global user.name "账号"
git config --global user.email "邮箱"
macOS查看当前配置的Git账号信息
git config --global user.name
git config --global user.email