Git远程仓库深入学习之(二):git fetch

本文详细介绍了Git的fetch命令,包括其基本介绍、四种用法和选项,例如如何同步所有远程仓库(`--all`),如何仅更新指定远程仓库和分支,以及如何使用`-f`或`+`进行强制更新。文中还特别提到了`FETCH_HEAD`的作用和不同Git版本的行为差异。
摘要由CSDN通过智能技术生成

1.git fetch的基本介绍(git fetch --help)

参考博客:https://www.cnblogs.com/ToDoToTry/p/4095626.html

NAME
       git-fetch - Download objects and refs from another repository

SYNOPSIS
       git fetch [<options>] [<repository> [<refspec>...]]
       git fetch --all [<options>]

OPTIONS

      --all
           Fetch all remotes.

      -f, --force
           When git fetch is used with <rbranch>:<lbranch> refspec, it refuses to update the local branch <lbranch> unless the remote branch <rbranch> it fetches is a descendant of <lbranch>. This option overrides that check.

<repository>
           The "remote" repository that is the source of a fetch or pull operation. This parameter can be either a URL (see the section GIT URLS below) or the name of a remote (see the section REMOTES below).这里需要注意的是repository就是指远程仓库,既可以是别名(origin或者git remote add所添加的),也可以是URL(git服务器+远程仓库名)

<refspec>
           The format of a <refspec> parameter is an optional plus +, followed by the source ref <src>, followed by a colon :, followed by the destination ref <dst>. The remote ref that matches <src> is fetched, and if <dst> is not empty string, the local ref that matches it is fast-forwarded using <

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值