我正在检查遥控器是否需要使用Check if pull needed in Git
中的方法进行拉动我在Python脚本中使用的方法如下所示:
% git fetch origin
# See if there are any incoming changes
% git log HEAD..origin/master --oneline
我不想留下副作用,所以我在想我应该清除这些东西。我该怎么做?
答案 0 :(得分:0)
您可以使用 git remote show 。它将显示您当地的分支机构并显示过时的分支机构:
Local refs configured for 'git push':
gh-pages pushes to gh-pages (up to date)
master pushes to master (local out of date)
staging pushes to staging (up to date)
在上面的示例中,它显示分支主服务器已过期,但它没有获取分支,因此您的本地存储库保持不变。