git 使用场景 本地分支 关联 远程分支

本地分支关联远程分支

bash 复制代码
# 同名时
git push --set-upstream origin release                   将本地分支 与 远程同名分支 相关联
git push -u origin release                               (git push --set-upstream origin release 缩写版本)

# 不同名时
git branch --set-upstream-to=origin/release2 release3    本地release3分支 和 远程origin/release2分支 建立关联
git push origin HEAD:release2                            分支名不同名时 push代码的方式
bash 复制代码
建立起联系后

1. .git/config配置文件 会追加 如下关联关系,故后续可以直接执行 git push
	[branch "release"]
		remote = origin
		merge = refs/heads/release

2. .git\refs\remotes\origin 里会追加文件 release

Ref git push -u origin master 与git push --set-upstream origin master

相关推荐
SelectDB5 小时前
秒级弹性、最高降本 70%:SelectDB Serverless 如何重塑云数仓资源效率
大数据·后端·云原生
WhoAmI5 小时前
MapReduce框架原理解析一:InputFormat
大数据·hadoop
WhoAmI5 小时前
MapReduce框架原理解析三:OutputFormat
大数据·hadoop
WhoAmI5 小时前
MapReduce框架原理解析二:Shuffle
大数据·hadoop
大大大大晴天1 天前
Hudi技术内幕:Key Generation原理与实践
大数据
Elasticsearch1 天前
3个信号、2个环境变量、0个采集器:使用 Python 和 Elastic 的托管 OTLP 端点实现 OpenTelemetry
elasticsearch
Elasticsearch3 天前
如何通过 Claude Code 来写入 CSV 数据到 Elasticsearch
elasticsearch
得物技术4 天前
从埋点需求到规则资产:Hermes Agent 重构得物数仓工作流
大数据·llm·ai编程
深海鱼在掘金5 天前
Git 完全指南 —— 第1章:Git 概览与版本控制演进
git