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

  • Home
  • SEARCH
  • 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 7926363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:44:51+00:00 2026-06-03T18:44:51+00:00

Is is possible to have a git repository ( clonable and pushable) be itself

  • 0

Is is possible to have a git repository ( clonable and pushable) be itself a clone of another remote repo?

The scenario:

We have an installation of gitorious for our company’s git hosting. We want to keep it updated but add some very private features ( mostly deploy scripts), hence the need to a pushable project. The desired workflow would be:

  • create a mygitorous as a pushable git repo
  • clone gitorious-official into mygitorious (not as submodule, as ref)
  • users now can clone and push mygitorious
  • I can then merge mygitorious with gitorious-official to update from upstream
  • I can update my deployed clone
  • users can update their clones with merged version

PS. Since these deploy scripts are very sensitive, I cannot simply make a public clone in gitorious and use it.

  • 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-06-03T18:44:52+00:00Added an answer on June 3, 2026 at 6:44 pm

    Sure. The whole idea behind a distributed version control system like git is that no repository is “special”. Any repository can be a clone of or destination of zero, one, or more other repositories.

    For example, assuming I have a repository repo1.git, I can do this:

    $ git clone --bare repo1.git repo2.git
    $ git clone repo2.git repo3
    $ cd repo3
    $ ...make some changes and commit...
    $ git push
    $ cd ../repo2.git
    $ git push
    

    If you follow that along, you can see I pushed repo3 –> repo2, and then repo2 –> repo1.

    Responding to your comment:

    You can’t run git checkout in a bare repository. That’s what fatal: This operation must be run in a work tree means. When you git clone a repository, you get two things:

    • A copy of the repository, contained in a .git directory, and
    • A “working copy”, or “work tree”, which is a directory containing the checked-out copies of files in the repository. A number of commands (checkout, pull) only make sense when you’re interacting with the working copy.

    Note, however, that it is tricky to push into a non-bare repository (that is, a repository with an associated working tree); git will throw an error without explicit configuration. You would see something along the lines of:

    To /home/lars/tmp/so/repo
     ! [remote rejected] foo -> foo (branch is currently checked out)
    error: failed to push some refs to '/home/lars/tmp/so/repo'
    

    This is because it would be surprising to have changes happening inside the repository underneath your working tree if other people were pushing into it. You can read more
    in this answer.

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

Sidebar

Related Questions

Is it possible to have a git repository as a vendor branch in subversion?
Is it possible to have a subversion repository as a submodule in git? In
I have a local git repository a central repo at github. I'm working on
I have heard that it is possible to have a local Git repository on
I have a git repository setup at C:\xampp\htdocs\wordpress . I'd like to clone it
Possible Duplicate: Is there any way to clone a git repository’s sub-directory only? clone
Is it possible to have git status only show the modified files due, in
It's possible that I'm not really understanding how git works here, but I have
Is it possible to have an association mapping a table to itself? e.g. Table:
I have a Git repository that is accessed from both Windows and OS X,

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.