git把本地项目push到远程仓库

环境

系统:windows

目录:D:/workspace/idea/spark-test

远程仓库:https://github.com/HanlaoTwo/SparkStudy.git

协议:https

创建版本库
#初始化
git init

Reinitialized existing Git repository in D:/workspace/idea/spark-test/.git/

#用命令git add告诉Git,把文件添加到仓库:
git add *
warning: LF will be replaced by CRLF in src/main/scala/sql/SparkSQLExample.scala.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/compiler.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/encodings.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/misc.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/modules.xml.
...

#提交
git commit -m "all is new"
[master (root-commit) 521cf14] all is new
warning: LF will be replaced by CRLF in .idea/compiler.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/encodings.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/misc.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/modules.xml.
提交到远程仓库
#添加
git remote add origin https://github.com/HanlaoTwo/SparkStudy.git
#报错,已存在
fatal: remote origin already exists.

#删除
git remote rm origin
#再添加
git remote add origin https://github.com/HanlaoTwo/SparkStudy.git

#提交
git push -u origin master
Username for 'https://github.com': hanlaotwo
Password for 'https://hanlaotwo@github.com':
Counting objects: 294, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (279/279), done.
Writing objects:  99% (292/294), 1.10 MiB | 68.00 KiB/s
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值