上传spring boot项目到github
此文章接《Spring Boot项目搭建》,演示如何将本地的spring boot项目集成git,发布到github。
1、找到项目中的.gitignore文件(文件中是gitoush时的忽略目录),文件中内容如下图所示:
2、修改文件内容,这里有一份比较全的忽略文件:
# maven ignore
target/
# gradle ignore
.gradle/
out/
build/
gradle/wrapper/gradle-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
# eclipse ignore
.settings/
.project
.classpath
classes/
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
/out/
# temp ignore
*.log*
*.cache
*.diff
*.patch
*.tmp
*.swp
# system ignore
.DS_Store
Thumbs.db
hs_err_pid*
### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
# sass ignore
.sass-cache/
*.css.map
3、github新建仓库
4、依次执行以下命令:
git init
git add .gitignore
git commit -m '.gitignore'
git remote add origin https:
git push -u origin master
将https:替换为自己对应的的github仓库地址,必须先add和push .gitignore 文件才会使忽略文件生效
5、再将剩余的代码push即可