一、在github建立仓库
二、推送代码
git init //初始化git
git commit -m "first commit" //为本次提交打标签
git branch -M master //指定推送的分支 或 为默认的当前分支
git remote add origin https://github.com/user-name/rep-name.git // 将本地仓库与新仓库关联
git push -u origin master // 推送
// 需要输入账号与密码
三、推送后新建分支继续开发
为避免版本混乱,需要新建分支,继续在
git checkout master //切换到主分支(master)
git checkout -b panda //创建并且切换到新分支(panda)
git add *
git commit -m "init panda"
git push origin panda
// 输入账号密码
四、参考
1、git如何新建分支 https://www.cnblogs.com/smileyes/p/8943234.html
2、git新手导引 https://github.com/