用git上传一个项目
首先登陆github创建一个项目
在自己的工程下运行
git init
把工程下的代码加至git
git add .
运行commit
git commit -m "***"
在github上添加origin
git remote add origin https://github.com/****/****.git
提交代码
git push -u origin master
在push前如果想知道更改了哪些东西 可以用 git status
如果提示如下错误
Github “Updates were rejected because the remote contains work that you do not have”
git pull origin master //先pull下来合并
git push origin master //然后再次提交
切换分支
git checkout yc
切换到一个分支.
git checkout -byc: 创建并切换到新的yc分支.
http://www.ruanyifeng.com/blog/2015/08/git-use-process.html
git rm -r --cached .
git add .
git commit -m 'update .gitignore'