1、gitup创建
2、初始化git
4. touch .gitignore
作用,把我们匹配的文件做一个忽略不会推送到git仓库上,也不会检查到本地一些变化
*.class
#package file
*.jar
*.war
*.ear
#kdiff3 ignore
*.orig
#maven ignore
target/
#eclipse ignore
.settings/
.project
.classpatch
#idea
.idea/
/idea/
*.ipr
*.iml
*.iws
# temp file 临时文件也不要
*.log
*.cache
*.diff
*.patch
*.tmp
# system ignore
.DS_Store
Thumbs.db
5、开始初始化了
git status
看到项目中哪些文件发生了变化
6、git status .
看到项目中哪些文件发生了变化
7 、提交
git commit -am ‘first commit init project’
这个只是提交到本地仓库
8、连接远程仓库
git remote add origin git@github.com:qingfeng5/spring_mall.git
查看分支git branch
8.1 、然后把本地的推送到master上
git push -u origin master
这里提交失败
8.2 先讲分支上的文件拉取上来
git pull
对他们进行强制推送
git push -u -f origin master