git init
git add .
"."代表的是所有文件git commit -m "你的提交描述"
提交到本地仓库git remote add origin 你的仓库地址
git push -u origin master
往主分支提交代码如果使用了其他的版本管理,最好将以前的版本管理去除
File->Setting->Version Control->Git
这里点击test测试一下本地是不是有git
VCS->Git(PS:如果没有这个选项的则可以选择Import into Version Control ->Create Git Repository)->Add(添加版本控制的文件,需要先选中所有根目录)/Remotes(关联远程仓库)/Clone(克隆远程仓库)/pull(拉取远程仓库)/push(提交本地仓库代码到远程仓库)
VCS->Git->Commit Directory 这里必须填写提交内容
VCS->Git->Push(只有push了其他人pull才有数据)
导入项目VCS->Import into Version Controller -> Import into Subversion 添加git地址就可以了
git rm -r –-cached .
git add .
git commit -m "update .gitignore"
原文:https://www.cnblogs.com/bananafish/p/12110859.html