git 关联本地代码与远程仓库

一、新建远程仓库

在这里插入图片描述
二、创建好仓库以后,在仓库首页,code标签下会有命令提示
在这里插入图片描述
比如,我想将javacode文件夹下的内容与远程仓库做关联

aaaaa@aaaaa MINGW64 /d/code/javacode
$ git init
Initialized empty Git repository in D:/code/javacode/.git/

aaaaa@aaaaa MINGW64 /d/code/javacode (master)
$ git add .
warning: in the working copy of 'ZookeeperDemo01/.gitignore', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'ZookeeperDemo01/pom.xml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'ZookeeperDemo01/src/main/java/org/example/Main.java', LF will be replaced by CRLF the next time Git touches it

aaaaa@aaaaa MINGW64 /d/code/javacode (master)
$ git commit -m "first commit"
[master (root-commit) 38fff7d] first commit
 10 files changed, 307 insertions(+)
 create mode 100644 ZookeeperDemo01/.gitignore
 create mode 100644 ZookeeperDemo01/.idea/.gitignore
 create mode 100644 ZookeeperDemo01/.idea/codeStyles/Project.xml
 create mode 100644 ZookeeperDemo01/.idea/codeStyles/codeStyleConfig.xml
 create mode 100644 ZookeeperDemo01/.idea/encodings.xml
 create mode 100644 ZookeeperDemo01/.idea/misc.xml
 create mode 100644 ZookeeperDemo01/pom.xml
 create mode 100644 ZookeeperDemo01/src/main/java/org/example/Main.java
 create mode 100644 ZookeeperDemo01/src/test/java/com/lxr/test/Test1.java
 create mode 100644 ZookeeperDemo01/src/test/java/com/lxr/test/Test2.java

aaaaa@aaaaa MINGW64 /d/code/javacode (master)
$ git branch -M main

aaaaa@aaaaa MINGW64 /d/code/javacode (main)
$ git remote add origin git@github.com:luckyLiaoLiao/BigData.git

aaaaa@aaaaa MINGW64 /d/code/javacode (main)
$ git push -u origin main
Enumerating objects: 25, done.
Counting objects: 100% (25/25), done.
Delta compression using up to 20 threads
Compressing objects: 100% (16/16), done.
Writing objects: 100% (25/25), 4.83 KiB | 4.83 MiB/s, done.
Total 25 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To github.com:luckyLiaoLiao/BigData.git
 * [new branch]      main -> main
branch 'main' set up to track 'origin/main'.

  • 14
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值