在github官网创建项目

idea上传项目到github_ide

idea上传项目到github_git_02


进入eureka项目目录

idea上传项目到github_远程仓库_03


3. 创建README

touch README

4. 创建.gitignore

*.class

#package files

*.war
*.ear

#kdiff3 ignore
target/
eurekaserver/target/
eurekaclient/target/

#eclipse ignore
.settings/
.project
.classpath

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

# temp file

*.log
*.cache
*.diff
*.patch
*.tmp


初始化为git版本控制

git init

idea上传项目到github_远程仓库_04


查看文件状态

git status


添加变更文件

git add .

提交到本地仓库

git commit -m "eureka project first submit"

链接远程仓库

git remote add origin https://github.com/${account}/eureka.git


远程pull到本地

git pull origin master


 push到远程仓库

git push -u origin master

#强制push的方法 以本地为主
git push -u origin master -f