1. 配置 upstream
首先需要从主库 fork 代码到用户空间下。
http://10.166.15.223:6880/autoeval/autoeval.git
fork =》
http://10.166.15.223:6880/cliffordl/autoeval.git
拉取代码,应该拉取用户的代码吧
[user@node3 ~]$ git clone http://10.166.15.223:6880/autoeval/autoeval.git
Cloning into 'autoeval'...
Username for 'http://10.166.15.223:6880': cliffordl
Password for 'http://cliffordl@10.166.15.223:6880': password
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (21/21), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 21 (delta 2), reused 0 (delta 0)
Unpacking objects服务器托管网: 100% (21/21), done.
首先查看 git remote 信息
[user@node3 autoeval]$ git remote -v
origin http://10.166.15.223:6880/cliffordl/autoeval.git (fetch)
origin 服务器托管网http://10.166.15.223:6880/cliffordl/autoeval.git (push)
添加主库 upstream。(是否需要为主库添加 upstream 并且推到远程。)
[user@node3 autoeval]$ git remote add upstream http://10.166.15.223:6880/autoeval/autoeval.git
[user@node3 autoeval]$ git remote -v
origin http://10.166.15.223:6880/cliffordl/autoeval.git (fetch)
origin http://10.166.15.223:6880/cliffordl/autoeval.git (push)
upstream http://10.166.15.223:6880/autoeval/autoeval.git (fetch)
upstream http://10.166.15.223:6880/autoeval/autoeval.git (push)
[user@node3 autoeval]$
禁止 push
[user@node3 autoeval]$ git remote set-url --push upstream no_push
[user@node3 autoeval]$
[user@node3 autoeval]$ git remote -v
origin http://10.166.15.223:6880/cliffordl/autoeval.git (fetch)
origin http://10.166.15.223:6880/cliffordl/autoeval.git (push)
upstream http://10.166.15.223:6880/autoeval/autoeval.git (fetch)
upstream no_push (push)
2.上传代码
将远程 upstream 的代码替换到当前 master 之上。也就是以 upstream 为最新。
[user@node3 autoeval]$ git checkout -b fix-1
拉取主库 upstream 代码
[user@node3 autoeval]$ git checkout master
Switched to branch 'master'
[user@node3 autoeval]$ git fetch upstream
Username for 'http://10.166.15.223:6880': cliffordl
Password for 'http://cliffordl@10.166.15.223:6880': password
From http://10.166.15.223:6880/autoeval/autoeval
* [new branch] master -> upstream/master
将主库 upstream 代码合并到本地 master 之上
[user@node3 autoeval]$ git rebase upstream/master
Current branch master is up to date.
将本地 master 推到用户仓库(而非主库)
[user@node3 autoeval]$ git push origin master
Username for 'http://10.166.15.223:6880': cliffordl
Password for 'http://cliffordl@10.166.15.223:6880': password
Everything up-to-date
[user@node3 autoeval]$
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
在人工智能(AI)和机器学习(ML)领域,Copilot已经成为一个备受瞩目的工具。它是由微软和OpenAI联合开发的,以帮助开发者更高效地完成编程任务。在这篇文章中,我将分享一些关于Copilot的实战经验,以及如何利用它来提高编程效率。 Copilot简介…