初始化git
git init
git add . //将项目里所有文件都添加到上传列表
git commit -m "init"
git remote add origin http://xxx.xxx/xxx/xxx.git
git push -u origin master
cat ~/.gitconfig 查看当前用户信息
git commit -am "init" 提交并且加注释
git commit -a 提交当前repository下当前分支的所有改变
git pull [remoteName][localBranchName]
git rm -r --cached .idea
branch
git branch 查看当前分支
git branch -r 查看远程分支
git branch [name] 创建分支,但仍位于当前分支
git checkout [name] 切换到新分支
git checkout -b [name] 创建分支,并切换到新分支
git merge [name] 将[name]分支合并到当前分支
git push origin [name] 创建远程分支(即将本地分支push到远程)
本文出自 “塞上名猪” 博客,请务必保留此出处http://zuohao1990.blog.51cto.com/6057850/1893343
原文:http://zuohao1990.blog.51cto.com/6057850/1893343