小白的我告诉你本地项目如何上传到github

1、进入项目所在的文件夹

 

cd /Users/simon/Documents/workspace/wp_201804/elastic-job-springboot-starter

 

执行:git init

 

把这个文件夹变成Git可管理的仓库

结果:

 

Initialized empty Git repository in /Users/simon/Documents/workspace/wp_201804/elastic-job-springboot-starter/.git/

此时,项目根路径下,会多出一个.git 隐藏文件夹,它是Git用来跟踪和管理版本库的.

执行:git status

可以看见所有文件

 

.gitignore

.mvn/

mvnw

mvnw.cmd

pom.xml

src/

 

2、执行:git add .(add 和.之间隔开)

 

查看状态:git status

 

new file:   .gitignore

new file:   .mvn/wrapper/maven-wrapper.jar

new file:   .mvn/wrapper/maven-wrapper.properties

new file:   mvnw

new file:   mvnw.cmd

new file:   pom.xml

new file:   src/main/java/com/foxiaotao/test/elasticjobspringbootstarter/ElasticJobSpringbootStarterApplication.java

new file:   src/main/java/com/foxiaotao/test/elasticjobspringbootstarter/config/MySimpleJob.java

new file:   src/main/java/com/foxiaotao/test/elasticjobspringbootstarter/controller/HomeController.java

new file:   src/main/resources/application.yml

new file:   src/main/resources/home.html

new file:   src/test/java/com/foxiaotao/test/elasticjobspringbootstarter/ElasticJobSpringbootStarterApplicationTests.java

 

3、提交,执行

 

 

git commit -m "add resource to remote repository"

4、在自己github建立一个项目

复制新建git的地址:https://github.com/foxiaotao/elastic-job-springboot.git

 

5、建立git client 端和githut的ssh

6、把代码提交到remote ( 注意吧git地址换成你们自己的项目 )

 

git remote add origin https://github.com/foxiaotao/elastic-job-springboot.git

 

git push -u origin master


7、推荐使用工具sourceTree

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值