git command to fetch the latest committed changes directly from the master repo rather than from the local repo.
mvb last edited by
I am new to git. I have a query on git.
In p4 we can check the latest changes submitted directly from the repository using
p4 changes -m 3 //depot/project/....
Is there a equivalent command available in git through which I can get the result of the latest committed changes directory from the master repo, rather than querying from my local repo.
I am aware of git log n 3 command but it will fetch me the result from my local repo, I want to fetch it directly from the master repo.
JonB last edited by
if you mean using the stash version of git, use
git fetch origin. (or whatever your remote name is) will bring the changes from the remote repo into yours, into a seperate remotes/origin spot, so wont override any of your pending changes (use git merge to do that).
there is not a super easy way to see the changes, other than to do a merge, then git diff before comitting (assuming it is not just a fast forward merge, which does not require a commit.). you can use
git resetto then go back to the pre merge state, or int the case of a fast forward merge, you'd need to point the branch back at the old sha.
backup before trying any of this, and make sure you have no uncommitted local changes!