其他技术----idea中配置git

Git

从命令行创建一个新的仓库

  1. git init
  2. git add . "."代表的是所有文件
  3. git commit -m "你的提交描述" 提交到本地仓库
  4. git remote add origin 你的仓库地址
  5. git push -u origin master 往主分支提交代码

IDEA中操作

  1. 如果使用了其他的版本管理,最好将以前的版本管理去除

  2. File->Setting->Version Control->Git

  3. 这里点击test测试一下本地是不是有git

  4. VCS->Git(PS:如果没有这个选项的则可以选择Import into Version Control ->Create Git Repository)->Add(添加版本控制的文件,需要先选中所有根目录)/Remotes(关联远程仓库)/Clone(克隆远程仓库)/pull(拉取远程仓库)/push(提交本地仓库代码到远程仓库)

  5. VCS->Git->Commit Directory 这里必须填写提交内容

  6. VCS->Git->Push(只有push了其他人pull才有数据)

  7. 导入项目VCS->Import into Version Controller -> Import into Subversion 添加git地址就可以了

IDEA 配置gitignore

  1. 下载插件 .gitignore
  2. 配置相应的gitignore 文件
  3. 进入项目包所在的文件夹
  4. git rm -r –-cached .
  5. git add .
  6. git commit -m "update .gitignore"
原文地址:https://www.cnblogs.com/bananafish/p/12110859.html