Non
Non

Reputation: 8589

General search for changes in every branch

I am on a project where I have 6 branches, there are 2 main branches: develop and master.

I am on develop right now, and lets say that I want to check if there are changes in the other branches, is there a way to check that from my branch? or I need to go over every single branch ?

Upvotes: 2

Views: 38

Answers (2)

Ajedi32
Ajedi32

Reputation: 48418

You can see a graph of all commits on all branches (including remote branches) by running git log --oneline ---graph --all. If you're looking for changes on a remote branch, be sure to run git fetch first to ensure that those branches are up to date with what's on the server.

Note that this only works for committed changes that have been pushed to the remote. Uncommitted changes or changes that haven't been pushed are not visible using this method.

Upvotes: 1

Thomas Stringer
Thomas Stringer

Reputation: 5862

Uncommitted changes

What you're talking about (uncommitted changes either in the working directory or the index) would be accomplished by "stashing" changes before switching to a different branch for difference work:

$ git stash

And then if you want to see what is stashed in the repository, you can simply run:

$ git stash list

That'll list out the stash index and the branch/commit that the uncommitted changes reside on.

This is provided you're looking to find out uncommitted changes across different commits/branches.

Committed changes

If you just want to see different committed changes across the branches, any variation of git log would suffice:

$ git log --graph --decorate --online --all

That's the typical one-liner I use for git log.

Both of these approaches should suffice in seeing committed and uncommitted changes across all branches/commits.

Upvotes: 1

Related Questions