Anonymous read-only Git access

Liu Hao lh_mouse@126.com
Thu Mar 5 07:31:00 GMT 2020


在 2020/3/5 14:33, Xi Ruoyao 写道:
> On 2020-03-05 13:50 +0800, yilu@bupt.edu.cn wrote:
>> Hi,everyone
>> I want to get the GCC-10 source and I followed the instructions in 
>> https://gcc.gnu.org/git.html, however, the command
>> git clone git://gcc.gnu.org/git/gcc.git SomeLocalDir
>> cannot work. 
>> And I found I cannot connect https://gcc.gnu.org/git/gcc.git even without
>> firewall(I'm in China). I got a 403 Forbidden
>>  "You don't have permission to access /git/gcc.git/ on this server."
>>  "Apache Server at gcc.gnu.org Port 443".  
>> What can I do in this situation? 
> 
> I guess some guy in BUPT "attacked" gcc.gnu.org somehow (maybe unintentionally,
> just playing or testing some software) and caused the entire IP segment to be
> banned.
> 
> You should contact the administrator of gcc.gnu.org.  In the meantime try
> 
>     git clone https://mirrors.tuna.tsinghua.edu.cn/git/gcc.git
> 
> It would be very fast since this mirror is in your city :).
> 
> (OT: Several BUPT students commenced some unsported behavior in our programming
> contests.  So our online judge is also banning BUPT IP segments.)
> 

The fact that Git may utilize HTTPS protocol doesn't imply that you can
list its contents with a web browser.


If you have issues cloning GCC's official GCC repo, here is some mitigation:

  # Create an empty repo with a working tree.
  mkdir gcc
  cd gcc
  git init

  # Add mirrors by hand.
  git remote add origin https://gcc.gnu.org/git/gcc.git
  git remote add github https://github.com/gcc-mirror/gcc.git
  git remote add tuna https://mirrors.tuna.tsinghua.edu.cn/git/gcc.git

  # Fetch from reachable mirrors first.
  # TUNA is unlikely to be unreachable from you, however it is
  # slightly left behind other mirrors.
  # This will fetch the bulk of the repo.
  git fetch tuna

  # Fetch more data from another mirror.
  # Objects that have been fetched from TUNA will not be fetched again.
  # There's supposed to be much fewer bytes to download.
  # GitHub is slower, but is less likely to be blocked by Chinese ISPs.
  git fetch github

  # Check out the master branch and initializes the working tree.
  # This is usually a bit behind `origin/master`.
  git checkout -b master github/master


  # Fetch data that have not been mirrored yet.
  # You may postpone this until you have access.
  git fetch origin

  # Set up its tracking branch.
  # You only need to set it once.
  # Note: This requires a successful fetch from `origin`.
  #       If that is not possible for you, please skip this step.
  git branch master --set-upstream-to=origin/master


-- 
Best regards,
LH_Mouse

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20200305/d4334340/attachment.sig>


More information about the Gcc-help mailing list