Himanshu Gupta
Himanshu Gupta

Reputation: 430

How can I find the files that were affected by my last pull?

I have a dev branch. I pulled code from a remote branch, i.e. origin/dev.

How would I know how many files are affected in my last git pull command?

Upvotes: 1

Views: 88

Answers (1)

ckruczek
ckruczek

Reputation: 2410

Well due to the fact you pulled and this means you also merged automatically this is kind of hard to establish. But, if you know the last commit before you pulled you could do a

git diff --name-only <lastcommit>..HEAD

If you want to avoid a automatic merge and see what files will be affected you could do the following:

git remote update -p
git diff --name-only master..origin/master

This will only fetch the changes into your working tree but will not perform a merge.

Upvotes: 2

Related Questions