从git创建分支后推送数据同步新的分支
- 创建分支
bash
git branch yzm ----创建git 分支
- 查看分支情况
bash
git branch----查看git 分支
- 选择进入的分支
bash
git checkout yzm----选择git分支
4.推送数据
存在问题(这个分支只在本地,远程gitee仓库不存在,要就要进行,同步创建分支)
bash
git push --推送 会报错
//fatal: The current branch yzm has no upstream branch.---因为远程没有这个分支
- 解决
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>