name_masked
name_masked

Reputation: 9794

Git - Listing commits that are not promoted to parent

When I run the command: git status on my local git branch, I see the following:

Your branch is ahead of 'origin/XXX' by 415 commits.
  (use "git push" to publish your local commits)                   
nothing to commit, working directory clean    

I am not sure how I got so many commits in my local branch when I did not do it. Is there a way for me to list all the commits + details associated with each commit so that I can understand what might have happened and if it safe for me to do a git push.

Upvotes: 0

Views: 44

Answers (2)

alextercete
alextercete

Reputation: 5151

I think you want to use Log and specify a range:

$ git log --oneline origin/XXX..HEAD

You can even omit HEAD:

$ git log --oneline origin/XXX..

Upvotes: 2

user376507
user376507

Reputation: 2066

The below command will give you the list of files changed locally and not present in remote

git diff origin/XXX <local_branch> --name-only

If you want the entire diff then use

git diff origin/XXX <local_branch>

Upvotes: 1

Related Questions