关于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+的硬性要求。 阅读详情

相关推荐

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

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

weixin_34055787的博客 455

remotes/origin/HEAD -> origin/master

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

{竹子} 4073

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

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

weixin_34007886的博客 440

git命令-切换分支

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

木凌的博客 79万+

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

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

二进制君 1950

红外通信不止遥控器:手把手教你用2ASK调制实现语音+温度数据同传

本文详细介绍了如何利用2ASK调制技术实现红外通信系统,同时传输语音和温度数据。通过STM32F103C8T6微控制器和DS18B20温度传感器的硬件设计,结合2ASK调制原理,展示了系统的完整实现方案。文章还提供了调试优化建议,适合电子爱好者和通信工程学生实践学习。

weixin_42531588的博客 391

删除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的博客 5575

Lumerical INTERCONNECT 中的自相位调制 (SPM) 仿真实践指南

本文详细介绍了在Lumerical INTERCONNECT中进行自相位调制(SPM)仿真的实践指南。从SPM的基础物理原理出发,深入解析非线性薛定谔方程和克尔效应,到INTERCONNECT中NLSE波导元件的配置技巧,以及时域与频域中SPM效应的观测方法。文章还提供了常见问题排查和进阶联合仿真技巧,帮助用户高效完成从仿真到实测的校准过程。

weixin_42565652的博客 193

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

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

Dontla的博客 1713

计数译码驱动显示电路实验报告_京东方G0A电路、阵列基板、显示 装置及驱动方法广州威彩...

图1、实施例二所述的选择子单元的结构示意图图2、实施例四所述的GOA电路结构示意图图3、实施例七所述的阵列基板的局部结构示意图图4、实施例所述的极性反转驱动方法的第一场的各信号时序图图5、实施例所述的极性反转驱动方法的第二场的各信号时序图图6、实施例所述的极性反转驱动方法的第三场的各信号时序图图7、实施例所述的极性反转驱动方法的第四场的各信号时序图图8、为图4所示时序下,实施例八所述显示...

weixin_35696112的博客 930

[特殊字符] 智能补货(AI-driven Replenishment)完整实施方案

补货量=预测需求+安全库存−当前库存补货量 = 预测需求 + 安全库存 - 当前库存补货量=预测需求+安全库存−当前库存。:基于 LSTM/Transformer 预测未来 30/60/90 天的销量。

nbsaas-boot基于Request-Response的企业级快速开发框架 977

remotes/origin/HEAD

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

little_kid_pea的博客 7033

突破Cloudflare 5秒盾:TLS指纹伪装+Playwright行为模拟,爬虫存活率从35%提至78%

TLS指纹精准识别:Cloudflare会解析客户端的TLS Client Hello包(如SSL版本、密码套件、扩展字段),Python的requests/urllib库的TLS指纹是“黑名单级”,请求一出即被拦截;行为特征检测:静态的浏览器伪装(如User-Agent)已失效,Cloudflare会监控页面加载后的行为(是否有鼠标移动、滚动、点击,行为是否机械);JS环境深度验证:通过WebGL、Canvas、字体渲染、Navigator属性生成浏览器指纹,无头浏览器的默认配置会被瞬间识别;

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 2368

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的博客 6012

YOLOv11【第一章:零基础入门篇·第10节】YOLOv11项目实战:从零搭建检测系统!

🏆 本文收录于专栏 《YOLOv11实战:从入门到深度优化》。本专栏围绕 YOLOv11 的改进、训练、部署与工程优化 展开,系统梳理并复现当前主流的 YOLOv11 实战案例与优化方案,内容目前已覆盖 分类、检测、分割、追踪、关键点、OBB 检测 等多个方向。

**My Coding Family** 5780

hadoop 切片机制详解

hadoop切片机制详解

congge 1万+

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

InTheHand.Net.Personal+BlueTooth4,蓝牙开发

项目中有蓝牙开发的必备dll,现在网上相关的文档博客不少,有的说的多有的说少,但是却很少有这两个dll,分享一下。

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万+

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

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

brew工具的重复安装

qq_36777191的博客 2438

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

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 6985

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的博客 2927

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、付费专栏及课程。

余额充值
⌂ 换网址