用Git上传整个文件夹

用Git上传整个文件夹

方法一:
1.进入文件夹目录(可用cd命令,也可以直接右击文件夹选择git Bash Here)
2.配置用户名,邮箱
3.初始化(输入git init)
4.关联仓库(git remote add origin +SSH地址)
假若之前已经连接,想改可以用 git remote rm origin删除,删除之后在重新连接(git remote add +SSH)。
5.上传(git push -u origin master)
如仓库里有文件夹里没有的文件需在git push前先git pull。

若你中途更改了用户名或者邮箱,会提醒你
remote: Coding 提示: Authentication failed.
remote: 认证失败,请确认您输入了正确的账号密码。
fatal: Authentication failed for ‘https://git.dev.tencent.com/…/…git/’
这时只用修改凭证即可。
用Git上传整个文件夹_第1张图片

方法二:
1.创建SSH key:ssh-keygen -t rsa -c “[email protected]
2.添加SSH key
用Git上传整个文件夹_第2张图片
用Git上传整个文件夹_第3张图片
3.新建仓库
用Git上传整个文件夹_第4张图片
4.上传GitHub
用Git上传整个文件夹_第5张图片
5.上传腾讯云
https://dev.tencent.com/help/git-import-tencentcloud

方法三
之前就配置好了用户名邮箱后
git init(初始化)
git remote add origin SSH(SSH地址)(关联仓库)
git pull(拉取)(获取到本地)(= git fetch + git merge )
git push -u origin master(推送到其他仓库)
克隆:git clone SSH(SSH地址)(克隆连接只需:git push不需要-u)

你可能感兴趣的:(用Git上传整个文件夹)