我如何知道哪个远程“父母”分支我的分支是基于? [英] How can I tell which remote "parent" branch my branch is based on?

查看:124
本文介绍了我如何知道哪个远程“父母”分支我的分支是基于?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个场景,其中有几个远程跟踪分支在我的本地存储库中,我必须同步。我们的工作流模型是:


  • 根据所需的远程追踪分支在本地创建分支

  • 进行修改

  • 建立/测试/修复

  • 提交

  • 推送到远程服务器



我注意到git status并不显示我的本地分支所基于的分支,除非有所改变。即未提交的本地更改或最近的提取使我的本地分支落后于时代。有什么方法可以知道我的本地分支是基于什么分支而不必改变它?就像git status -showparentbranch或者其他一些会显示这个的命令。偶尔我会遇到这种需求,但不知道如何去满足它。 解决方案

试试这个:

  git log --graph --decorate 


I have a scenario in which there a several remote tracking branches within my local repository that I must sync up to. Our workflow model is:

  • make a branch locally, based off of the desired remote tracking branch
  • make our changes
  • build/test/fix
  • commit
  • push back to the remote server

I've noticed that "git status" doesn't show me what branch my local branch is based on unless something has changed; i.e. uncommitted local changes or a recent fetch puts my local branch behind the times. Is there some way of knowing what branch my local branch is based on without having to change things? Something like, "git status -showparentbranch" or some other command that would show this. Occasionally I run into this need but don't know yet how to satisfy it.

解决方案

try this:

git log --graph --decorate

这篇关于我如何知道哪个远程“父母”分支我的分支是基于?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆