I'm sure this can be done (?) (in clearcase it would be quite simple).
To get all the changes from all the branches, use git fetch --all . And if you'd like to clean up some of the branches that no longer exist in the remote repository, git fetch --all --prune will do the cleaning up!
git fetch <remote> Fetch all of the branches from the repository. This also downloads all of the required commits and files from the other repository. git fetch <remote> <branch>
Short Answergit checkout origin/master -- path/to/file // git checkout <local repo name (default is origin)>/<branch name> -- path/to/file will checkout the particular file from the downloaded changes (origin/master).
Use git log
to determine a suitable revision to switch to, e.g.:
git log --since='2010-04-01' --until='2010-04-02'
This will show all the commits on 2010-04-01, so just pick the one that corresponds to the instant you want the files for, and note its commit id. Then just use git checkout COMMIT-ID
to switch the workspace to that commit. This will detach your workspace (HEAD) from the current branch, use git checkout master
to return.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With