一、新建远程仓库
二、创建好仓库以后,在仓库首页,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'.