从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> 
相关推荐
李永奉5 小时前
Git和GitHub-用操作命令控制Git 分支的查看、创建、切换、合并与删除管理实操教程
git·github
7177779 小时前
SVN 迁移到 Git 用什么工具:git-svn、svn2git 与平台化方案的取舍
git·svn
李永奉1 天前
Git和GitHub-用操作命令控制Git的工作区、暂存区、本地仓库之间状态的提交教程
git·github
羊在吃青草1 天前
Git之远程仓库
git
凉、介1 天前
Git 深入理解(二) | 常用命令
大数据·git·elasticsearch
xuxie992 天前
GIT版本管理
git
茶栀(*´I`*)2 天前
Git从零开始操作清单
git
李永奉2 天前
Git和GitHub-Git 管理的版本数据到底保存在哪个文件夹里?
git·github
Mortalbreeze2 天前
Git 基础篇(二):本地仓库管理与常用操作
git
武昌库里写JAVA5 天前
SpringBoot+Vue 项目介绍
java·javascript·git·sql·ai