git存储变化适用于新分支? [英] git stash changes apply to new branch?

查看:80
本文介绍了git存储变化适用于新分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做主分支,做了一些改变,然后把它们藏起来。现在,我的主人在HEAD。



但是现在,我想检索这些更改,但要从主分支的HEAD版本分支出一个新分支。



如何做到这一点? 是标准程序不工作?




  • 进行更改

  • git储存

  • git checkout xxx

  • git储存弹出



更短:


  • 进行更改

  • git stash

  • git checkout -b xxx

  • git stash pop


I was working on master branch, made some changes and then stashed them. Now, my master is at HEAD.

But now, I want to retrieve these changes but to a new branch which branches from the HEAD version of the master branch.

How do i do this ?

解决方案

Is the standard procedure not working?

  • make changes
  • git stash save
  • git branch xxx HEAD
  • git checkout xxx
  • git stash pop

Shorter:

  • make changes
  • git stash
  • git checkout -b xxx
  • git stash pop

这篇关于git存储变化适用于新分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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