💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
git fetch命令 功能:用于从另一个存储库下载对象和引用,但是不合并本地版本库 * 将某个远程主机的更新 git fetch <远程主机名> <分支名> git fetch origin master 取回远程主机的更新以后,可以在它的基础上,使用git checkout命令创建一个新的分支 [root@linux7-node3 shell-code]# git checkout -b newbranch origin/master 然后查看没有问题后,在切换到master分支,合并过来 [root@linux7-node3 git]# git status On branch master Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded. (use "git pull" to update your local branch) nothing to commit, working directory clean [root@linux7-node3 git]# git branch -a * master newbranch remotes/origin/HEAD -> origin/master remotes/origin/master [root@linux7-node3 git]# git merge newbranch Updating 3ac4346..2d04606 Fast-forward git/install_git.sh | 1 + 1 file changed, 1 insertion(+) [root@linux7-node3 git]# git branch -d newbranch Deleted branch newbranch (was 2d04606).