关于remotes/origin/HEAD -> origin/master

git分支详解——记住这些指令能帮助你解决大部分git的分支问题 阅读详情

 

$git branch -a
*master

remotes/origin/HEAD -> origin/master

retmotes/origin/master
git remote set-head [origin] [branch]/git remote set-head test master

SYNOPSIS

git remote [-v | --verbose] git remote add [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror] <name> <url> git remote rename <old> <new> git remote rm <name> git remote set-head <name> (-a | -d | <branch>) git remote set-branches <name> [--add] <branch>… git remote set-url [--push] <name> <newurl> [<oldurl>] git remote set-url --add [--push] <name> <newurl> git remote set-url --delete [--push] <name> <url> git remote [-v | --verbose] show [-n] <name> git remote prune [-n | --dry-run] <name> git remote [-v | --verbose] update [-p | --prune] [(<group> | <remote>)…]

DESCRIPTION

Manage the set of repositories ("remotes") whose branches you track.

OPTIONS

-v --verbose

Be a little more verbose and show remote url after name. NOTE: This must be placed between remote and subcommand.

COMMANDS

With no arguments, shows a list of existing remotes. Several subcommands are available to perform operations on the remotes.

add

Adds a remote named <name> for the repository at <url>. The command git fetch <name> can then be used to create and update remote-tracking branches <name>/<branch>.

With -f option, git fetch <name> is run immediately after the remote information is set up.

With --tags option, git fetch <name> imports every tag from the remote repository.

With --no-tags option, git fetch <name> does not import tags from the remote repository.

With -t <branch> option, instead of the default glob refspec for the remote to track all branches under $GIT_DIR/remotes/<name>/, a refspec to track only <branch> is created. You can give more than one -t <branch> to track multiple branches without grabbing all branches.

With -m <master> option, $GIT_DIR/remotes/<name>/HEAD is set up to point at remote’s <master> branch. See also the set-head command.

In mirror mode, enabled with --mirror, the refs will not be stored in the refs/remotes/ namespace, but in refs/heads/. This option only makes sense in bare repositories. If a remote uses mirror mode, furthermore, git push will always behave as if --mirror was passed.

rename

Rename the remote named <old> to <new>. All remote-tracking branches and configuration settings for the remote are updated.

In case <old> and <new> are the same, and <old> is a file under $GIT_DIR/remotes or $GIT_DIR/branches, the remote is converted to the configuration file format.

rm

Remove the remote named <name>. All remote-tracking branches and configuration settings for the remote are removed.

set-head

Sets or deletes the default branch ($GIT_DIR/remotes/<name>/HEAD) for the named remote. Having a default branch for a remote is not required, but allows the name of the remote to be specified in lieu of a specific branch. For example, if the default branch fororigin is set to master, then origin may be specified wherever you would normally specify origin/master.

With -d, $GIT_DIR/remotes/<name>/HEAD is deleted.

With -a, the remote is queried to determine its HEAD, then $GIT_DIR/remotes/<name>/HEAD is set to the same branch. e.g., if the remoteHEAD is pointed at next, "git remote set-head origin -a" will set $GIT_DIR/refs/remotes/origin/HEAD to refs/remotes/origin/next. This will only work if refs/remotes/origin/next already exists; if not it must be fetched first.

Use <branch> to set $GIT_DIR/remotes/<name>/HEAD explicitly. e.g., "git remote set-head origin master" will set$GIT_DIR/refs/remotes/origin/HEAD to refs/remotes/origin/master. This will only work if refs/remotes/origin/master already exists; if not it must be fetched first.

set-branches

Changes the list of branches tracked by the named remote. This can be used to track a subset of the available remote branches after the initial setup for a remote.

The named branches will be interpreted as if specified with the -t option on the git remote add command line.

With --add, instead of replacing the list of currently tracked branches, adds to that list.

set-url

Changes URL remote points to. Sets first URL remote points to matching regex <oldurl> (first URL if no <oldurl> is given) to <newurl>. If <oldurl> doesn’t match any URL, error occurs and nothing is changed.

With --push, push URLs are manipulated instead of fetch URLs.

With --add, instead of changing some URL, new URL is added.

With --delete, instead of changing some URL, all URLs matching regex <url> are deleted. Trying to delete all non-push URLs is an error.

show

Gives some information about the remote <name>.

With -n option, the remote heads are not queried first with git ls-remote <name>; cached information is used instead.

prune

Deletes all stale remote-tracking branches under <name>. These stale branches have already been removed from the remote repository referenced by <name>, but are still locally available in "remotes/<name>".

With --dry-run option, report what branches will be pruned, but do not actually prune them.

update

Fetch updates for a named set of remotes in the repository as defined by remotes.<group>. If a named group is not specified on the command line, the configuration parameter remotes.default will be used; if remotes.default is not defined, all remotes which do not have the configuration parameter remote.<name>.skipDefaultUpdate set to true will be updated. (See git-config(1)).

With --prune option, prune all the remotes that are updated.

DISCUSSION

The remote configuration is achieved using the remote.origin.url and remote.origin.fetch configuration variables. (See git-config(1)).

Examples

  • Add a new remote, fetch, and check out a branch from it

    $ git remote
    origin
    $ git branch -r
    origin/master
    $ git remote add linux-nfs git://linux-nfs.org/pub/linux/nfs-2.6.git
    $ git remote
    linux-nfs
    origin
    $ git fetch
    * refs/remotes/linux-nfs/master: storing branch 'master' ...
      commit: bf81b46
    $ git branch -r
    origin/master
    linux-nfs/master
    $ git checkout -b nfs linux-nfs/master
    ...
  • Imitate git clone but track only selected branches

    $ mkdir project.git
    $ cd project.git
    $ git init
    $ git remote add -f -t master -m master origin git://example.com/git.git/
    $ git merge origin

SEE ALSO

Author

Written by Junio Hamano

Documentation

Documentation by J. Bruce Fields and the git-list <git@vger.kernel.org>.

GIT

Part of the git(1) suite

 

OpenShift Origin为何无法在CentOS 6.5上部署 OpenShift Origin作为Kubernetes增强型PaaS平台,其运行高度依赖现代Linux内核特性(如cgroups v1/v2、namespaces、SELinux策略粒度)及用户空间基础设施(systemd、runc、较新glibc)。CentOS 6.5基于2.6.32内核、glibc 2.12和SysV init,缺乏对容器运行时、CRI接口及安全模块的底层支持,导致Docker无法稳定运行,更无法满足Origin v1.3+对内核≥3.10、systemd和Go 1.7+的硬性要求。 阅读详情

相关推荐

Salt Master 安装不是命令执行,而是基础设施宪法奠基

Salt Master 是 SaltStack 分布式配置管理架构的核心中枢,其本质是集证书颁发中心(CA)、指令分发总线、状态编排引擎与事件总线于一体的基础设施‘数字主权机构’。它基于 ZeroMQ 的 Pub/Sub + Req/Rep 混合通信模型,依赖严格的时间同步、内核参数调优与 SELinux/ AppArmor 策略适配,技术价值在于提供毫秒级响应、强一致性批量操作与配置即代码(GitOps)治理能力。典型应用场景包括金融/电信核心系统自动化运维、跨云环境(AWS/阿里云/本地超融合)统一管控

weixin_34007886的博客 439

remotes/origin/HEAD -> origin/master

如果签出了master,则HEAD是master。如果签出了另一个分支(或者只是一个提交),则情况并非如此,因为head是对当前提交的引用。

{竹子} 4071

git基础教程(26) github远程仓库操作(下)

前文中,我们初步的认识了远程仓库,并且了解了一些相关的基本操作,这篇文章我们继续聊。 我们已经知道,当我们需要多人协作时,可以利用远程仓库交换代码,如果你创建的远程仓库是私有仓库,则只有仓库的成员才能对仓库中的代码进行操作,那么,我们就从"为项目添加成员"这个话题开始吧。 我们先来看看为仓库添加成员的具体操作步骤,仍然使用前文中创建的github私有仓库为例,现在我有两个github账号,两个账号分别是zsythink和zhushuangyin,我用这两个账号模拟仓库的管理员和项目成员,zsythink是仓

二进制君 1945

git命令-切换分支

git一般有很多分支,我们clone到本地的时候一般都是master分支,那么如何切换到其他分支呢?主要命令如下

木凌的博客 79万+

WIN下使用visual studio 2022安装GMSSL命令行工具

2.1 使用管理员权限打开visual studio(非常重要,否则最后一步 nmake install会失败)右键vs2022,以管理员身份运行即可。2.4 配置环境变量,gmssl可执行程序默认会被安装到如下目录。将如下路径添加到系统环境变量即可。添加后的环境变量如下。2.编译解压后的gmssl源码,编译过程主要参考install.md中的内容,README.md中的步骤不完整。2.2 打开vs2022的命令终端,右键文件,选择在终端中打开。1.下载gmssl源码,解压到相应目录。

qq_45794382的博客 1269

手把手拆解UCIe协议层:从Raw Mode到Flit Mode,数据包到底经历了什么?

本文深入解析UCIe协议层的数据包处理机制,从Raw Mode到Flit Mode的三大变体(Standard 256B、68B-Enhanced、Latency-Optimized),详细揭示数据包在不同模式下的封装与转换过程。通过工程师视角,展示协议层如何实现多模式动态切换、错误恢复及与D2D Adapter的协同设计,为芯片级互连技术提供实践指导。

weixin_28728495的博客 238

删除remotes/origin/HEAD -> origin/master指针

删除remotes/origin/HEAD -> origin/master指针 问题现象: 从github远程仓库克隆代码,默认情况下,当前指针将位于remotes/origin/HEAD,它是远程仓库引用的符号分支。 解决办法: 使用git remote set-head origin -d删除origin/HEAD符号引用,删除后效果如下: 具体命令用法可参考git remote 的帮助说明 ...

qq_39314099的博客 5570

保姆级教程:在SIwave 2024 R2中搞定TDR仿真,手把手教你分析USB 3.0差分线阻抗

本文提供了一份详细的SIwave 2024 R2 TDR仿真教程,重点讲解如何分析USB 3.0差分线阻抗。从项目准备、参数配置到结果分析,逐步指导工程师完成完整的仿真流程,并分享实战经验和高级技巧,帮助提升信号完整性分析能力。

weixin_33670786的博客 493

git不同分支含义(git分支)(FETCH_HEAD、remotes/origin/HEAD、remotes/origin/master、remotes/origin/dev)

分支图中,不同颜色代表不同类型的分支(绿色为本地分支,洋红色为远程分支)。右键点击仓库文件夹 ->

Dontla的博客 1703

【FPGA】Robei EDA的使用(10)————如何更新EDA的使用license

#海卑而下,能聚众水;学问笃实,以生光辉。 有的时候,有些问题自己通过查找资料解决,宁愿磨难一下,走点弯路,但收获更深刻的认知;不过,有些问题,问一下别人,可能会避免自己耗费过多时间做无用工,这些问题问会的人是极好的。但是怎样把握这个问题的类型,大约只能靠经验了~ (问我为何出此感言,谁叫我纠结了两天的问题,被人家一句话解决,我这个恨啊) ————————————————————正文开始的分割线———————————————— Robei EDA在使用上会有一个注册码,这个license在获取之后,每一次的

Ninquelote的博客 1002

4、基于球面波展开的近场/远场变换技术解析

本文深入解析了基于球面波展开的近场/远场变换技术,涵盖坐标系统选择、截断测量处理、高级SWE方法及实际应用场景。重点介绍了广义SWE、全探头补偿、平移SNF测量(TSWE)等关键技术,结合吸收材料与导电地板系统的误差处理方案,系统总结了各类方法的优缺点与适用场景,并通过流程图和案例分析展示了技术应用路径。该技术在汽车、通信和航空航天领域的天线测量中具有重要价值,可显著提升测量效率与精度。

dell8的博客 255

remotes/origin/HEAD

默认指向origin/master,得用vim修改.git/refs/remotes/origin/HEAD才能更改HEAD的指向

little_kid_pea的博客 7032

【Claude Code】Not logged in 未登录错误解决方案 + /login 认证路径

Claude Code 启动时提示 Not logged in 表示当前会话缺少有效凭证。本文从环境变量、API Key 配置、CI 自动化凭证脚本和系统时钟四个维度,提供完整的认证排查流程与修复方案。

多媒体编程、网络编程、系统编程、网络安全编程、驱动编程 892

git pull 报错 warning: ignoring broken ref refs/remotes/origin/HEAD

unable to resolve reference ‘refs/remotes/origin/master’: reference broken 大概就是报这两个错,偶尔操作不慎会造成这样的后果,字面意思就是远程分支和本地分支对应不起来了,大概率是本地分支坏了 把.git/refs/heads(存放本地分支)和.git/refs/remote/origin(存放远程分支) 两个文件夹中报错的分支删掉,然后执行 git fetch(把远程仓库的分支更新到git),fetch成功后就不会报错了,剩下的随便操

qq_41539461的博客 6011

金砖大赛-第二届网络安全防护治理实战技能大赛全国总决赛WP

格式进行md4加密,然后将小写的md4密文进行作为flag信息进行提交,提交格式为flag{MD4小写},例如调用频率异常高的user_id是user_xxx,使用的非公开模型名称是model-name,具体调用次数为10,那么按照格式,对user_xxx:model-name:10进行md4加密后,提交范例为:flag{dd00cb9e393f4a9ac639294b3cfe4d6a}挖矿木马是通过远程脚本进行部署的,请登录到失陷的服务器上,找到并分析挖矿木马是从那个远程IP下载的。

Laffrey的专栏 238

【C++】DDS:FastDDS环境配置与使用示例

FastDDS环境配置与使用示例

DevFrank的博客 6505

Git branching: master vs. origin/master vs. remotes/origin/master

Git branching: master vs. origin/master vs. remotes/origin/master up vote67down votefavorite 20 I think I'm on the right track to understand the basic concepts of

我不会编程,但不是完全不会,我会一点点 2245

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

git深入理解(二):HEAD是什么

HEAD指的就是 .git/HEAD 文件,它存储着当前working directory所处的某次commit,打开文件内容为 ref: refs/heads/master refs目录下存储的是仓库和tags,每个仓库下又有分支,每个tags下又有tag,一个tag对应的某次commit。 存储 local master 分支的最新commit对象的SHA-1 refs/heads/master 存储远程仓库 master 分支的最新commit对象的SHA-1 refs/remotes/origi

猛犸象 2万+

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

brew安装问题:error: Not a valid ref: refs/remotes/origin/master

brew工具的重复安装

qq_36777191的博客 2437

Mac安装homebrew报错 error: Not a valid ref: refs/remotes/origin/master

mac安装homeberw后报错如下: Press RETURN to continue or any other key to abort ==> /usr/bin/sudo /usr/sbin/chown -R aa:admin /opt/homebrew ==> Downloading and installing Homebrew... HEAD is now at 8de10a05b Merge pull request #10472 from MikeMcQuaid/new-issu

HiTaQini 6983

2021-07-12Git - git pull时遇到error: cannot lock ref ‘refs/remotes/origin/master‘: unable to resolve...

git pull时遇到问题及解决方法问题描述:解决方法及原因分析:1、git log 错误:解决方法:修复 .git/refs/heads/分支名原因分析:IDE的错误关闭2、git pull 错误:解决方法:原因分析: 问题描述:   重新启动电脑后,打开项目,发现多了很多修改(1K+),执行git pull 及git log命令时,均会报错。现记录下解决方法(网络整理,真实可用): git pull 报错:error: cannot lock ref ‘refs/remotes/origin/mast

lookingForw_4585的博客 2925

Git remote 不是命令,而是分布式协作的元协议层

Git remote 是 Git 分布式版本控制系统中实现仓库间通信与同步的核心抽象机制,其本质并非简单的 URL 配置,而是涵盖协议适配、权限绑定、引用映射和缓存策略的元协议层。它决定 fetch/push 的传输栈(HTTPS/SSH)、凭证作用域、远程分支在本地的镜像路径(refs/remotes/),以及多源协同(如 origin/upstream)的拓扑关系。理解 remote 的配置逻辑,是保障 CI/CD 稳定性、企业安全合规、跨组织代码复用与子模块治理的技术前提。本文深入解析 git rem

weixin_34055787的博客 454

Git error solution for “unable to resolve reference” “unable to update local ref”

大清早就遇到一个意外的问题,幸好在stackoverflow上找到了对应topic error: unable to resolve reference refs/remotes/origin/master: No such file or directory ! [new branch] master -&gt; origin/master (unable to upda...

Lockey23的博客 1557

Git 的origin和master分析

Git 的origin和master分析 - Lishic的日志 - 网易博客   http://lishicongli.blog.163.com/blog/static/1468259020132125247302/ 首先要明确一点,对git的操作是围绕3个大的步骤来展开的(其实几乎所有的SCM都是这样) 1.     从git取数据(git clo

嵌入式技术在路上 393

电脑突然断电蓝屏导致Git错误的一种解决办法

电脑突然断电蓝屏导致Git错误的一种解决办法

u010257765的专栏 2091

git下载问题warning: remote HEAD refers to nonexistent ref, unable to checkout

去网上查找原因,网上基本说的都一致,说是没有master分支,应该用git show-ref查找有效分支,选择一个分支下载就可以了,完全没有明白(我是git小白),直接输入git show-ref完全没有反应,那应该怎么办呢?

sping115116的博客 1671
上一篇: 如何成为一个Linux内核开发者
下一篇: windows安装基于Apache的SVN服务器(包括SSL配置)
sanlinux
博客等级 码龄17年 92粉丝 158原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值