您的位置:首页 > 编程语言

本地新建项目提交到github

2016-11-09 16:23 190 查看
1.在github上创建项目(可以添加README.md),创建后的地址为
https://github.com/xxx/xxx-demo.git
2.在eclipse上新建个quick-start的maven工程

3.shell下进入该工程所在地址

cd xxx-demo


4.初始化git

git init


5.建立远程连接

git remote add origin https://github.com/xxx/xxx-demo.git


6.拉取服务端的文件

git pull origin master


7.编辑.gitignore文件,排除毫无关系的文件

vim .gitignore


.target/
.logs/
*/logs/
*/*/logs/
*/target/

# maven ignore
target/
*.war
*.zip
*.tar
*.tar.gz

# eclipse ignore
.settings/
.project
.classpath

# idea ignore
.idea/
*.ipr
*.iml
*.iws

# temp ignore
*.log
*.cache
*.diff
*.patch
*.tmp

# system ignore
.DS_Store
Thumbs.db
logs/


8.添加基础文件

git add .


9.提交本地文件

git commit -m "first commit"


10.推送文件到远程服务器

git push -u origin master
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: