Ginu Jacob
Ginu Jacob

Reputation: 1818

Viewing unpushed git commit "by others"

How can we view or get a diff file for an unpushed commit by another person (not by me) with the sha/commit ID. I see many answers for the commits made by myself Viewing Unpushed Git Commits, but didn't see for someone else's commit.

Upvotes: 0

Views: 1715

Answers (2)

Chris Dodd
Chris Dodd

Reputation: 126508

To see what's in someone else's repo, you need to add their repo as a remote with git remote add. That requires that the repo be accessable to you via a URL, which requires some work on the part of the owner. If they grant you ssh access to their machine, you can use a ssh: url to access their repo. If they're running a web service, they can set it up so that you can access it via http: or https:. Alternately, they can run git daemon to run a little read-only git: service.

Upvotes: 0

merlin2011
merlin2011

Reputation: 75629

This is not possible by definition. A commit that someone else hasn't pushed is local to their machine.

The only way to see unpushed commits would be to log into whatever machine they are working on, and cd into their working directory if they're willing to let you do that. Then, run the same commands you would in your own local git clone. However, this is equivalent to acting as them, from git's point of view.

Upvotes: 1

Related Questions