SpongePablo
SpongePablo

Reputation: 890

How to know the files that I have in different branches of GIT?

Imagine that I have 2 branches.

In branchA I have files A and B

In branchB I have deleted the file B and added the file C, si I finally have A and C

Which command could I use to know that I have deleted B and created C?

Upvotes: 2

Views: 76

Answers (2)

Kent
Kent

Reputation: 474

git diff --name-status branchA branchB

This will list the files added, deleted, renamed, or modified along with a one letter code showing whether it was added, deleted, renamed, or modified. It should show something like:

D        dir1/B
A        dir2/C

Where D means deleted and A means added.

Upvotes: 2

lgomezma
lgomezma

Reputation: 1637

To see the abbreviated stats of each commit you can use:

git log --stat -2

Change the number for the number of commits that you want to display. In this case it will show the last two commits. Don't forget to checkout to the branch that you want to check first.

Upvotes: 0

Related Questions