简体   繁体   中英

Which remote branch is my git subtree tracking?

Let's say there was a remote with a master, as well as a dev branch, and I added it into a subtree:

$ git remote add rem [URL]
$ git fetch rem
$ git subtree add -P=./sub rem/dev

Now every time I run git subtree pull -P sub , the branch rem/dev will be fetched and merged into sub. Ok

But lets say later on I forgot whether I added from the master or dev branch. Other than inferring by comparing git logs, is there a way git will tell me which branch of rem is the subtree in sub/ tracking?

Subtrees are tricky...

There will be a .gittrees file in the root of your working directory, with content such as:

[subtree "sub"]
    url = git://example.com/repo.git
    path = sub
    branch = master

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM