Reputation: 9387
suppose i have a file with version 4 and the same file on the remote repository server is version 8. I would like to get the list of versions for the project/file.
Then i would like to merge my file with may be version 6.
how would i got about doing this
Thanks
Upvotes: 0
Views: 355
Reputation: 467071
Note that in git, each version (commit) describes the complete state of your repository, rather than versioning on a per-file basis.
You can do something like what you want with the following commands:
git fetch origin
This updates all your "remote-tracking branches" from the remote repository referred to as origin
. You can think of this as like updating the state of your local cache of all the branches from origin.
Then the following command will then list all the commits that introduced changes to the the file docs/foo.txt
that you don't have in your current branch locally:
git log -p ..origin/master -- docs/foo.txt
The -p
option says to also include a full diff between versions in the output. You can leave that out for more concise output that just shows you the commit messages.
Upvotes: 1