Git development
 help / color / mirror / Atom feed
From: "Lamborn, Peter Craig" <plamborn@lanl.gov>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Cc: "Nielsen, Johnathan Patrick" <jnielsen@lanl.gov>,
	"Herrera, Thomas Anthony" <taherrera@lanl.gov>
Subject: GIT_SSH and mirror not working with git 2.30.1
Date: Tue, 16 Mar 2021 18:53:24 +0000	[thread overview]
Message-ID: <e39d23615e084671965fc96174ac881e@lanl.gov> (raw)


We have some machines behind firewalls and gateways that cannot access git repos directly.  We have been using GIT_SSH and mirror to push and pull git request through a less restricted machine.  This has been working for a while, specifically both git 2.24.1 and git 2.28 can handle the method we have been doing. 


When you try the same thing with git 2.30.1, the "git push" commands still succeed.  But "git pull" returns this:


$ git pull <mirror name>
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.


ssh: connect to host <destination machine> port 22: Operation timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$

Does git 2.30.1 change something about mirrors and/or GIT_SSH that would cause git pulls to fail?  Do we need to adjust our current process?

Our method:

destination_machine$ mkdir <DZPATH>
destination_machine$ cd <DZPATH>
destination_machine$ git --bare init

...

workstation$ cat ssh-hop.sh
#!/bin/bash
  
MACHINE_REGEXP="<...>"
  
if [[ $1 =~ $MACHINE_REGEXP ]]; then
  
  exec ssh <gateway> ssh "$@"
  
else
  exec ssh "$@"
fi

workstation$ chmod u+x ssh-hop.sh
workstation$ export GIT_SSH=<path to>/ssh-hop.sh
workstation$ cd <git repo>
workstation$ git remote add --mirror <mirror name> <destination_machine>:<DZPATH>
workstation$ git push <mirror name>
workstation$ git pull <mirror name>



Thank you,

Peter

             reply	other threads:[~2021-03-16 18:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16 18:53 Lamborn, Peter Craig [this message]
2021-03-16 19:55 ` GIT_SSH and mirror not working with git 2.30.1 Andreas Schwab
2021-03-16 20:33 ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e39d23615e084671965fc96174ac881e@lanl.gov \
    --to=plamborn@lanl.gov \
    --cc=git@vger.kernel.org \
    --cc=jnielsen@lanl.gov \
    --cc=taherrera@lanl.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox