💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
配置github远程仓库 如果是第一次配置github远程仓库,需要设置用户名和邮箱,并添加远程地址,给远程仓库起个别名 ~~~ git config --global user.name "github用户名" git config --global user.email "your_github_email@qq.com" //查看git配置: git config --lis      q退出 git remote add origin( origin:别名) git@github.com:yourName/yourRepo.git ~~~ ![](https://img.kancloud.cn/c9/1b/c91b28663235c1ac0d0ccea45e607c2c_480x65.png) 还需要需要执行git config --global init.defaultBranch master否则会报错 [git - 虚无缥缈的云 - 博客园 (cnblogs.com)](https://www.cnblogs.com/lichihua/p/7767348.html) 查看[帮助](https://gitee.com/oschina/git-osc/wikis/%E5%B8%AE%E5%8A%A9),[Visual Studio](https://gitee.com/help/articles/4118)/[TortoiseGit](http://my.oschina.net/longxuu/blog/141699)/[Eclipse](https://gitee.com/help/articles/4119)/[Xcode](http://my.oschina.net/zxs/blog/142544)下如何连接本站,[如何导入仓库](http://www.oschina.net/question/82993_133520) 创建 git 仓库: ~~~ mkdir b2b2c cd b2b2c //创建本地仓库git init 或者 git clone https://gitee.com/xxx/xxx.git git init //创建README.md文件 touch README.md //将本地文件推入本地暂存区 git add README.md //镜本地暂存区的文件添加到本地仓库 git commit -m "first commit" //为远程github仓库生成别名(clone的项目省略这步) git remote add origin https://gitee.com/xxx/xxx.git git push -u origin "master" ~~~ >[danger] git pull <远程主机名(远程库别名)> <远程分支名>:<本地分支名> git push <远程主机名(远程库别名> <本地分支名>:<远程分支名> 设置远程库的别名( origin:远程库别名):`git remote add origin git@github.com:yourName/yourRepo.git` 创建库没有创建人恶化文件的时候如可能默认的`README`,`LICENSE`,`.gitignore` ``` mkdir b2b2c cd b2b2c //创建本地仓库git init 或者 git clone https://gitee.com/xxx/xxx.git git init //复制整个项目到b2b2c文件夹 //将本地文件推入本地暂存区 git add ./ //镜本地暂存区的文件添加到本地仓库 git commit -m "first commit" //为远程github仓库生成别名(clone的项目省略这步) git remote add origin https://gitee.com/xxx/xxx.git git push -u origin "master" ``` 如果创建时创建了默认的`README`,`LICENSE`,`.gitignore`时,我们可以用`git clone https://gitee.com/xxx/xxx.git` 然后git pull 后再复制项目到文件夹,或者删了生成的远程`README`,`LICENSE`,`.gitignore` 第一次使用git时 需要执行git config --global init.defaultBranch master否则会报下面的错误 ``` hint: Using 'master' as the name for the initial branch. This default branch nam e hint: is subject to change. To configure the initial branch name to use in all hint: of your new repositories, which will suppress this warning, call: hint: hint: git config --global init.defaultBranch <name> hint: hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and hint: 'development'. The just-created branch can be renamed via this command: hint: hint: git branch -m <name> Initialized empty Git repository in E:/BaiduNetdiskDownload/B2B2C/bbb/.git/ ``` 已有仓库? ~~~ cd existing_git_repo git remote add origin https://gitee.com/lichihua/b2b2c.git git push -u origin "master" ~~~