从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> 
相关推荐
lsc_blog10 小时前
年底还在招的岗位,先确认缺口和到岗要求
git·缓存·ci/cd·职场和发展·github
全栈陈序员15 小时前
【Git】从入门到精通(十一)—— git reset 三种模式详解
git·elasticsearch
全栈陈序员18 小时前
【Git】从入门到精通(十)—— 撤销与恢复:git checkout与git restore
运维·网络·数据库·git
全栈陈序员1 天前
【Git】从入门到精通(五)—— git add:将文件加入暂存区
大数据·git·elasticsearch
全栈陈序员1 天前
【Git】从入门到精通(七)—— git status:查看仓库状态
大数据·git·elasticsearch
莫晓燚1 天前
Ansible 13 个常用模块---企业实战
git·github
无言听风雨丶2 天前
Kubernetes GitOps 持续交付实战:用 Argo CD 让 Git 成为集群事实源
git·elasticsearch·kubernetes
全栈陈序员2 天前
【Git】从入门到精通(六)—— git commit:提交到版本库
大数据·git·elasticsearch
全栈陈序员2 天前
【Git】从入门到精通(一)—— Git简介:什么是版本控制系统
大数据·git·elasticsearch
大猫会长2 天前
git笔记
git