从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> 
相关推荐
2301_809815255 小时前
Git和Gitee基本使用教程
git·gitee
雨翼轻尘6 小时前
01_Git概述及基本操作
git·概述·基本操作
程序员果子9 小时前
CrewAI :当 Agent 学会团队协作
人工智能·git·python·多智能体·agent框架
‎ദ്ദിᵔ.˛.ᵔ₎9 小时前
Git GDB/CGDB调试器
git·gdb
他们都叫我GPT侠11 小时前
【无标题】
git·github
果汁华11 小时前
CLI 命令行与 Python 框架实战
git·python·github
zzzzzz31012 小时前
我用 AI Agent 重构了日常开发工作流,效果出乎意料
人工智能·git·github
我叫黑大帅1 天前
git 的 NFD 与 NFC 有什么区别?为什么我有个文件在 NFC 中间不会被当成改动,在 NFD 中就会当成改动
git·面试·github
呆萌很1 天前
Git push 408 超时、远程断开解决办法
git
Lesile1 天前
Hands-on Git experience
git