基础操作
初始化:git init
加入缓存区:git add *
提交到本地仓库:git commit -m *
关联远程仓库:git remote add origin 远程仓库地址
提交到远程仓库:git push -u origin “master”
同步远程的最新内容:git pull origin master
git pull origin master --allow-unrelated-histories(适用于本地创建的仓库,并且这个仓库当中存在文件,等于说是将这两个仓库合并)
克隆远程仓库:git clone 远程仓库地址
检出标签:git checkout -b [branch][tag]
IDEA中使用
打开terminal窗口:Alt + F12
提交到远程仓库的时候忽略.idea文件:在.gitignore文件中添加:
#pycharm .idea
mall/.idea/*
.idea/*