I am trying to access a branch's commit history on a remote repository. I had a look at the doc but could not find any substantial information on how to access a remote repo's commit history using my local git client.
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
I don't believe this is possible. I believe you have to clone that remote repo locally and perform
git fetch
on it before you can issue agit log
against it.Will display the log of a given remote branch in that repository, but only the logs that you have "fetched" from their repository to your personal "copy" of the remote repository.
Remember that your clone of the repository will update its state of any remote branches only by doing
git fetch
. You can't connect directly to the server to check the log there, what you do is download the state of the server withgit fetch
and then locally see the log of the remote branches.Perhaps another useful command could be:
which will show you the commits that are in the remote branch, but not in your current branch (
HEAD
).You can only view the log on a local repository, however that can include the fetched branches of all remotes you have set-up.
So, if you clone a repo...
This will default to
origin/master
.You can add a remote to this repo, other than
origin
let's addproduction
. From within the local clone folder:If we ever want to see the log of
production
we will need to do:This fetches from ALL remotes (default fetch without
--all
would fetch just fromorigin
)After fetching we can look at the log on the
production
remote, you'll have to specify the branch too.All options will work as they do with log on local branches.
This is what worked for me:
Note that this fetches from ALL remotes, i.e. potentially you "have to clone 2GB worth of objects just to look through the commit logs".
You can easily get the log of the remote server. Here's how:
(1) If using git via ssh - then just login to the remote server using your git login and password-- and chdir the remote folder where your repository exists- and run the "git log" command inside your repository on the remote server.
(2) If using git via Unix's standard login protocol- then just telnet to your remote server and do a git log there.
Hope this helps.