【问题标题】:How 1. git stash 2. git pull origin master 3. git stash apply, on a single command?1. git stash 2. git pull origin master 3. git stash 如何在单个命令上应用?
【发布时间】:2013-03-26 20:09:59
【问题描述】:

如何在 MacOSX 上通过一个命令完成此操作?

git stash
git pull origin master
git stash pop

我已经尝试使用 git stash && git pull origin mater && git stash apply 并且工作正常。

【问题讨论】:

  • 在旁注中,您可能需要git stash pop 作为最后一部分,否则会不断堆积。

标签: macos git command-line


【解决方案1】:

使用git aliases。例如

[alias]
  spullsa = "!git stash && git pull origin mater && git stash apply"

【讨论】:

    【解决方案2】:

    如果你想要比设置 git 别名更“官方”的东西,你可能会对http://www.git-legit.org/ 感兴趣。你所做的类似于“git sync”。

    【讨论】:

      猜你喜欢
      • 2012-09-10
      • 2013-05-03
      • 2020-07-27
      • 2011-02-22
      • 2016-04-08
      • 2012-12-25
      • 2013-12-22
      • 1970-01-01
      相关资源
      最近更新 更多