Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 822005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:44:09+00:00 2026-05-15T02:44:09+00:00

I am setting up a Git repository. I know you can add repositories using

  • 0

I am setting up a Git repository. I know you can add repositories using git config --global, but is there a way that those known repositories gets cloned by users?

The goal would be that once the repo gets cloned by userz, they can push to other repos just by their aliases.

For example, I add git://X/mobility.git as X to the repo (somehow), a user clone it from git://Y, but then can do git push X without previously doing the git config.

How to do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:44:10+00:00Added an answer on May 15, 2026 at 2:44 am

    Amber is right. The configuration of remote entries is not cloned along with the rest of the repository (nor is any other repository specific configuration data).

    You might consider including (in the tracked content of the repository) a script to setup the remotes. End users could run this script to create the remotes. The script can not, however be run automatically since it would introduce security problems (cloning a repository should be a safe operation; it would not be a safe operation if Git automatically ran some script/binary that it just downloaded).

    Incidentally, it might be easier using git remote to manage the remotes instead of git config.

    add_or_update() {
        if git config remote."$1".url >/dev/null 2>&1; then
            git remote set-url "$1" "$2"
        else
            git remote add "$1" "$2"
        fi
    }
    add_or_update foo git@server.example.com:foo.git
    add_or_update add bar git://other.example.com/dev/bar.git
    

    If you are using a non-standard fetch refspec, you may need to use git config, since git remote does not (yet) support managing a remote’s refspec(s).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can you recommend any no-brainer solution for setting up a git repository accessible via
I have several non-bare Git repositories. There is one central Git repository (or at
I have followed the following instructions in setting a git repository locally in one
Setting onchange event for CheckBoxList using the following code doesn't work. chkListUserGroup.Attributes.Add(onchange, document.forms[0].isRecordModified.value='true';); How
I have a Git repository that is accessed from both Windows and OS X,
I have tried following how-set-up-your-own-private-git-server-linux and private-remote-git-repositories-ubuntu-linode but I am still having problems. My
In my iPhone app, I am using the in-built Git repository of Xcode 4
My project is setting up using git and upload to svn. However, i forgot
Setting up a git repository with some messy commits. Everything is working and all
I have a GIT repository that I manage for my office. Because of company

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.