从git创建新分支后推送数据同步新的分支

从git创建分支后推送数据同步新的分支

  1. 创建分支
bash 复制代码
 git branch yzm ----创建git 分支
  1. 查看分支情况
bash 复制代码
 git branch----查看git 分支
  1. 选择进入的分支
bash 复制代码
git checkout yzm----选择git分支

4.推送数据

存在问题(这个分支只在本地,远程gitee仓库不存在,要就要进行,同步创建分支)

bash 复制代码
 git push   --推送 会报错
 //fatal: The current branch yzm has no upstream branch.---因为远程没有这个分支
  1. 解决
bash 复制代码
 git push --set-upstream origin yzm----使用创建同步分支和推送
bash 复制代码
PS C:\Users\84961\Desktop\htmlknow> git branch yzm----创建git 分支
PS C:\Users\84961\Desktop\htmlknow> git branch----查看git 分支
* master
  yzm
PS C:\Users\84961\Desktop\htmlknow> git checkout yzm----选择git分支
Switched to branch 'yzm'
PS C:\Users\84961\Desktop\htmlknow> git branch      
  master
* yzm
PS C:\Users\84961\Desktop\htmlknow> git add . ---暂存数据
PS C:\Users\84961\Desktop\htmlknow> git push   --推送
fatal: The current branch yzm has no upstream branch.---因为远程没有这个分支
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin yzm----使用创建和推送

To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.

PS C:\Users\84961\Desktop\htmlknow> git push --set-upstream origin yzm ----推送和创建分支
 * [new branch]      yzm -> yzm
branch 'yzm' set up to track 'origin/yzm'.
PS C:\Users\84961\Desktop\htmlknow> 
相关推荐
Patrick_Wilson3 小时前
为什么gitlab的MR会默认有一个merge commit
前端·git·gitlab
是乐乐啊呀3 小时前
版本控制 GIT 和 SVN
git·svn
夜鸣笙笙6 小时前
Git详细安装流程
git
瑞码空间20 小时前
git知识点黄金笔记
笔记·git·elasticsearch
----云烟----20 小时前
Git 提交忽略某些文件方法
git
切糕师学AI1 天前
如何查看已合并到 master 分支的所有分支?Git 分支清理指南
大数据·git·elasticsearch
DevUp1 天前
一个管「引」,一个管「抄」:Submodule 和 Subtree 到底差在哪
git·前端工程化
lingran__1 天前
Git 完全指南(三):远程仓库与标签管理
开发语言·git·gitee·ssh·团队协作·远程仓库·分布式版本控制
lingran__2 天前
Git 完全指南(二):分支管理
git·分支管理·版本控制·团队协作·多人开发·git flow
必须会一定会2 天前
Agent Handoff v0.6.0 跨电脑同步:Git、EVENTS.jsonl、CONTEXT.md 使用方法
人工智能·git·ai编程