git create remote branch (五)

[email protected] MINGW64 ~/WebstormProjects/backEndServer (master)

查看本地分支信息
$ git branch
* master

[email protected] MINGW64 ~/WebstormProjects/backEndServer (master)

查看分支最后一次提交信息
$ git branch -v
* master 1c4ed79 #AHB-20 add get device subdevice list

[email protected] MINGW64 ~/WebstormProjects/backEndServer (master)

创建本地分支
$ git branch test-protocol

[email protected] MINGW64 ~/WebstormProjects/backEndServer (master)

查看本地分支信息
$ git branch
* master
test-protocol

[email protected] MINGW64 ~/WebstormProjects/backEndServer (master)

查看远程分支信息
$ git branch -r
origin/HEAD -> origin/master
origin/master

[email protected] MINGW64 ~/WebstormProjects/backEndServer (master)

#查看所有的分支信息
$ git branch -a
* master
test-protocol
remotes/origin/HEAD -> origin/master
remotes/origin/master

[email protected] MINGW64 ~/WebstormProjects/backEndServer (master)

#切换到本地test-protocol分支
$ git checkout -b test-protocal
Switched to a new branch ‘test-protocal‘

[email protected] MINGW64 ~/WebstormProjects/backEndServer (test-protocal)

# 查看分支信息
$ git branch -a
master
* test-protocal
test-protocol
remotes/origin/HEAD -> origin/master
remotes/origin/master

[email protected] MINGW64 ~/WebstormProjects/backEndServer (test-protocal)

# 将本地test-protocol分支推送至远端
$ git push origin test-protocal:test-protocal
Total 0 (delta 0), reused 0 (delta 0)
remote:
remote: Create a pull request for ‘test-protocal‘ on GitHub by visiting:
remote: https://github.com/13701761349/backEndServer/pull/new/test-protoca
remote:
To https://github.com/13701761349/backEndServer.git
* [new branch] test-protocal -> test-protocal

[email protected] MINGW64 ~/WebstormProjects/backEndServer (test-protocal)
$ git branch -a
master
* test-protocal
test-protocol
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/test-protocal

[email protected] MINGW64 ~/WebstormProjects/backEndServer (test-protocal)
$

[email protected] MINGW64 ~/WebstormProjects/backEndServer (master)
$ git branch -r
origin/HEAD -> origin/master
origin/master
origin/test-protocal

[email protected] MINGW64 ~/WebstormProjects/backEndServer (master)

#拉取远程分支版本

#git checkout -b 本地分支名 origin/远程分支名

$ git checkout -b test-protocal origin/test-protocal
Switched to a new branch ‘test-protocal‘
Branch ‘test-protocal‘ set up to track remote branch ‘test-protocal‘ from ‘origin‘.

原文地址:https://www.cnblogs.com/lianghong881018/p/11612398.html

时间: 2024-10-10 23:14:22

git create remote branch (五)的相关文章

git fetch remote branch

http://stackoverflow.com/questions/9537392/git-fetch-remote-branch/ git fetch <remote> <rbranch>:<lbranch> git checkout <lbranch> ... where <rbranch> is the remote branch or source ref and <lbranch> is the as yet non-ex

git 四个区五种状态

一张图看明白Git的四个区五种状态 五种状态间的顺序操作 四个区 工作区(Working Area) 暂存区(Stage) 本地仓库(Local Repository) 远程仓库(Remote Repository) 五种状态 未修改(Origin) 已修改(Modified)&未追踪(Untracked) 已暂存(Staged) 已提交(Committed) 已推送(Pushed) 顺序操作 第零步:工作区与仓库保持一致 第一步:文件增删改,变为已修改状态 第二步:git add ,变为已暂存

git查看各个branch之间的关系

1.pull所有branch for remote in `git branch -r `; do git branch --track $remote; done for remote in `git branch -r `; do git checkout $remote ; git pull; done 2.查看branch之间关系 git log --graph --all --decorate --simplify-by-decoration --oneline branch - Tr

Git Tutorial 5 - Branch and Merge

Branch is a very important concept in Git and doing branch is one of the greatest features. It plays like the concept of context when you're working on it. You can have multiple branches in your repo, and in a time you're working in only one of them.

git fatal: remote origin already exists. 报错解决

在研究git的时候,随便输了个 git remote add origin xxx; 然后再真正add 远程仓库的时候,报了git fatal: remote origin already exists.的错误 学习源头:https://blog.csdn.net/top_code/article/details/50381432 解决方法: git remote rm origin 然后再 git remote add origin 你的远程git地址 1.先删除远程 Git 仓库 $ git

每日一条 Git 命令:git merge remote master

每日一条 Git 命令:git merge remote master 当远程的分支更新后,需要将自己的代码与远程的分支合并就用以下这个命令合并. git merge remote master 如果这个项目是 fork 过来的,这个 remote 可以改成 原项目的项目名,当合并时会比较直观点. 原文地址:https://www.cnblogs.com/F4NNIU/p/9877753.html

git remote branch操作

将本地branch basic提交到remote的basic上: git push origin basic:basic 将remote的 basic branch更新到本地的 basic branch上: git fetch git merge basic (尽量不要用 git pull,会隐藏很多细节)

Git 出现Branch master set up to track remote branch master问题 与忽略文件上传

错误:在push 到远程仓库是一直提示下列错误,检查了使用status检查了也没有发现错误,最后排查出来是当前分支为((no branch))即右上那个id (┬_┬)..... 原因:出现这个问题的根本原因在于推送的分支没有做commit操作,直接原因是,在idea整合是错误的创建了一个分支*(no branch) 并一直在该分支下执行push master指令. 解决方案:合并分支到master 并检查status,切换分支:git checkout master.检查冲突(一般是没有的).

git之remote repository create(远程仓库创建)

1.在Git bash窗口执行如下指令创建SSH KEY: ssh-keygen -t rsa -C "[email protected]" 此时会在用户主目录下生成.ssh文件: 打开.ssh文件,会发现里面生成了id_rsa和id_rsa.pub两个文件,这两个就是SSH Key的秘钥对,id_rsa是私钥,不能泄露出去,id_rsa.pub是公钥,可以放心地告诉任何人. 2.登录github 进入setting 添加SSH KEY