git检出另一个分支的代码_使用git检出上一个分支

git检出另一个分支的代码

Command line shortcuts are can be a huge time saver, which is why I like creating bash aliases and and enjoy other tricks I've found.  I do have a list of tasks I don't yet have a shortcut for, like easy switching between my current branch and the previous branch.  I have to do this often when I update master via remote pull and then rebasing a feature branch, and since many of my branch names include a hard to remember bug number, switching between branches is a pain.

命令行快捷键可以节省大量时间,这就是为什么我喜欢创建bash别名并享受发现的其他技巧的原因。 我确实有一个我没有快捷方式可完成的任务列表,例如在当前分支和上一个分支之间轻松切换。 当我通过远程请求更新master然后重新建立功能分支时,我经常必须这样做,并且由于我的许多分支名称都包含一个难以记住的错误号,因此在分支之间进行切换是很痛苦的。

I recently found out that you can switch the the previous branch you were on using the following command:

我最近发现,您可以使用以下命令切换以前的分支:


git checkout master

# Do whatever
git pull remote master

# Go back to the previous branch
git checkout -


Using - references the previous branch name, thus allowing you to navigate branches with ease!

使用-引用先前的分支名称,从而使您可以轻松导航分支!

翻译自: https://davidwalsh.name/checkout-previous-branch-git

git检出另一个分支的代码

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值