【问题标题】:git: inspect the contents of files in other branches without modifying any repositories [duplicate]git:检查其他分支中文件的内容而不修改任何存储库[重复]
【发布时间】:2013-12-28 03:50:32
【问题描述】:

我需要在另一个分支上工作,不知道是哪个分支。列出了几个,我可以根据某些关键文件的内容确定我需要哪个分支。有没有办法只看一下分支中的一些文件?另外,这是我使用stash的地方吗?

【问题讨论】:

  • 谢谢。只需寻找合适的词。

标签: git


【解决方案1】:
git show branch:file

会工作:)

你也可以跑

git grep pattern branch

这样你就可以从其他分支 grep 文件

您可以使用git checkout 从另一个分支获取文件。

【讨论】:

    猜你喜欢
    • 2013-03-03
    • 1970-01-01
    • 2022-07-14
    • 2020-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-06
    • 2022-12-04
    相关资源
    最近更新 更多