
首先在 Github 上创建一个仓库,它将用于存储、同步本地 Jyputer 里的项目。

获取到仓库的 SSH 地址。

下面的文件夹就是我想同步的项目工程。

在当前文件夹下依次使用如下命令:
git init 初始化项目。
git add 项目文件夹 添加项目。
git commit -m "说明" 初始化项目。
git remote add origin 指定仓库的SSH地址 初始化项目。
git push -u origin master 上传项目到 Github。
详细演示过程如下:
XIAOLANZAO+Administrator@xiaolanzao MINGW64 /c/Py_jupyter
$ git init
Initialized empty Git repository in C:/Py_jupyter/.git/
XIAOLANZAO+Administrator@xiaolanzao MINGW64 /c/Py_jupyter (master)
$ git add pytools
XIAOLANZAO+Administrator@xiaolanzao MINGW64 /c/Py_jupyter (master)
$ git commit -m "first commit"
[master (root-commit) 382fbf4] first commit
1 file changed, 287 insertions(+)
create mode 100644 "pytools/src/pytools/jacoco\345\205\250\351\242\206\345\237\237\346\212\223\345\217\226\345\267\245\345\205\267.py"
XIAOLANZAO+Administrator@xiaolanzao MINGW64 /c/Py_jupyter (master)
$ git remote add origin git@github.com:2418546511/Py_jyputer.git
XIAOLANZAO+Administrator@xiaolanzao MINGW64 /c/Py_jupyter (master)
$ git push -u origin master
Warning: Permanently added the RSA host key for IP address '192.30.255.113' to the list of known hosts.
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (6/6), 4.25 KiB | 2.13 MiB/s, done.
Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
To github.com:2418546511/Py_jyputer.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.效果图如下:

可以看到 Github 上已经同步过来了。

后面更新代码再上传的话只需使用下面的命令就可以了:
git add 项目文件夹 添加项目。
git commit -m "说明" 初始化项目。
git push -u origin master 上传项目到 Github。