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 8559625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:05:48+00:00 2026-06-11T16:05:48+00:00

If I have an empty repository git init and I want to pull in

  • 0

If I have an empty repository git init and I want to pull in another repository to be used only for pulling in updates how can I do this if I want the files to be in the root directory?

So,

lets say:

cd ~/repositories
mkdir newrepo
cd newrepo
git init
echo "testfile" > readme.md
git add .
git remote add <whatever>
git push -u origin master

#ok so that part works fine
#now we have our repository at <my_other_repository> that looks like
#a_root_file.ext
#directory/another_file.ext

#so now I want to run something like:
git clone <my_other_repository>

#and end up with:
#readme.md
#a_root_file.ext
#directory/another_file.ext

#if I then run
echo "edited testfile" > readme.md
git status
#I want to be told that
#untracked changes
#newfile: a_root_file.ext
#newfile: directory/another_file.ext
#modified: readme.md

#running
git commit -a -m "Some files from another repository"
git push
#should push everything up to the <whatever> repository

#then I want to be able to run
git pull <my_other_repository_name>
# and have it pull in any upstream changes

Is this something it is possible to setup?

I imagine I could work around it slightly by having a “wrapper directory”

cd ~/repositories
mkdir newrepo
cd newrepo
git init
git remote add <whatever>
mkdir wrapper #this will now be the root of my project
cd wrapper
echo "testfile" > readme.md
cd ../
git add .
git push -u origin master

I should then be able to run git clone <my_other_repository> without issue but this will only work if I only want to merge in one repository, and I am wanting to merge in several repositories and I also wonder what would be tracking the changes since there are now two repositories watching the same files, would both track them? or would <whatever> say “hey these are under this repository, so we won’t track 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-11T16:05:50+00:00Added an answer on June 11, 2026 at 4:05 pm

    I’m not quite sure exactly what you’re asking for here, but you should be aware that you can have more than one remote. For example, you could:

    git remote add another <my_other_repository>
    

    Then, you can pull in updates using git fetch another. You can then merge in updates using:

    git merge another/master
    

    to merge updates from your other repository into your local repository.

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

Sidebar

Related Questions

Can git commit empty versions of some files? The case in point is that
I have a git repository with some commits in it. I want to reproduce
I have a GIT repository on bitbucket, which I want my Jenkins Server to
I have a csv file which may have empty or blank rows. I want
I have files which have many empty cells which appear as NaNs when I
I want to store my local modifications to JBoss config in git. For this,
I have a Git repository with about a two years of history in it.
I have a situation with a relatively large git repository located in a virtual
I have cloned an empty repository. I have an empty master branch. I need
I have set up a git repository on my local machine and a bare

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.