相关疑难解决方法(0)

检查Git中是否需要拉

如何检查远程存储库是否已更改,我需要拉?

现在我使用这个简单的脚本:

git pull --dry-run | grep -q -v 'Already up-to-date.' && changed=1
Run Code Online (Sandbox Code Playgroud)

但它相当沉重.

有没有更好的办法?理想的解决方案是检查所有远程分支,并返回已更改分支的名称和每个分支的新提交数.

git bash shell

600
推荐指数
15
解决办法
34万
查看次数

如何让git-status检查两个不同的遥控器?

每个git用户都习惯于此:

> git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean
Run Code Online (Sandbox Code Playgroud)

然而,最近我开始使用两个遥控器而不是一个(heroku和github,非常标准的情况,我认为),它开始让我烦恼只能在git status输出中看到1个原点.

我怎么能添加其他遥控器所以我会看到这样的东西?

> git status
On branch master
Your branch is up-to-date with 'origin/master'.
Your branch is up-to-date with 'heroku/master'.

nothing to commit, working directory clean
Run Code Online (Sandbox Code Playgroud)

(这个问题与heroku或github无关,这只是一个方便的例子.)

git git-status

13
推荐指数
2
解决办法
3445
查看次数

标签 统计

git ×2

bash ×1

git-status ×1

shell ×1