1

I have a couple of git repos.
One is used for development of specific features (say xyz), while one is the mainline (say main).

We periodically pull(sometimes cherrypick as well) changes to main from xyz.

I am looking for a command that shows me a log (git log like output) of the changes present in xyz, but not in main

I tried to look for a command, but couldnt find one.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Marcus White
  • 41
  • 1
  • 6

1 Answers1

0

I will assume that by 'main' or 'xyz' you are talking about branches inside the same repository.

You can start with git log --oneline --no-merges ^main xyz but that would list cherry-pick commits.

You can also launch an interactive rebase, which will list all commits from xyz to base on top of main: any cherry-picked commits will not be listed.

git switch xyz
git rebase -i main

You can then abort the interactive rebase session from the editor.

If those are not from the same repository, but still have a common history (meaning one repo was done from the other), the same idea apply

cd /path/to/repo/xyz
git switch xyz
git remote add repomain /url/repo/main
git fetch repomain
git rebase -i repomain/main
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • They are not branches in the same repo. They are different repos, but with almost the same content. One is used for dev of specific areas (like xyz) and all such repos have specific dev content. main pulls in content from xyz by doing a git pull on that repo. – Marcus White Mar 23 '21 at 08:59
  • @MarcusWhite OK, I have edited the answer to adapt it to multiple repositories. – VonC Mar 23 '21 at 13:08