github连接远程仓库并上传项目
1.找到项目,初始化git
git init
这里在项目中产生.git
2.创建.gitignore文件
在项目文件夹下设置.gitignore文件,在该文件中,配置无需要上传的文件类型(用正则表达式,学习学习)
*.png
*.jpg
*.mat
*.npy
*pyc
*pkl
*zip
#常用忽略数据集类型
3.将项目文件加到本地仓库
git add .
注意:这里加一条查看和github连接的配置
git config --list
https.proxy=http:172.16.13.171:8080
user.email=
user.name=
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
可以看到和github连接的用户名和邮箱配置
4.提交到本地仓库
git commit -m "提交引言"
就可以看到
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-5XSGZmai-1610542793089)(C:\Users\70902\AppData\Roaming\Typora\typora-user-images\image-20210113205244310.png)]
5. 提交到远程仓库
5.1连接远程仓库
git remote add origin XXX
#XXX不要写HTTPs路径,写git@github.com:Cassie317/CSMRI.git
5.2push
git push -u origin master
r-images\image-20210113205813027.png" alt=“image-20210113205813027” />
即上传成功!!!