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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:37:06+00:00 2026-05-20T19:37:06+00:00

Git beginner question: I have a small private webproject which is versioned locally with

  • 0

Git beginner question:

I have a small private webproject which is versioned locally with msysgit. There is no exterior repository, as it’s only for me, so i can bascially do whatever I want.

I’ve had this set up in the project directory, ie in “webroot”.

Now a second directory had to be created, placed parallel to webroot. Let’s call it assets.

So structure is now as follows:

\ project directory
----\webroot
----\assets

I’d love to include this new directory in the git repository, so that I’d also version changes to files stored there, but of course I can’t use “git add ../assets”. Neither am I inclined to create a new git project in project_directory, as this would loose all my previous commits.

So how do I go about moving the repository out of “webroot” up into “project_directory”, while keeping my commits and then being able to include “assets”?

  • 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-20T19:37:07+00:00Added an answer on May 20, 2026 at 7:37 pm

    So, you want your git repo to look like this:

    <projectdir>
        /.git
        /webroot
        /assets
    

    To do this, you must move the existing files in your repo into a new webroot subdirectory.

    cd <git repo root>
    mkdir webroot
    git mv <all your files> webroot
    git commit --all -m "moved all existing files to new 'webroot' directory"
    

    Then, on your local filesystem you want to relocate your clone one directory above where it is now:

    cd <projectdir>
    mv webroot/* .
    rmdir webroot
    

    Then you want to add the assets directory (and files) to the git repo:

    git add assets
    git commit -m "added assets to the repo"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems like a pretty beginner question; however, I have no idea what the
Beginner Git question: In the Mercurial world, hg tags gives me a list of
I am a beginner in using Rails and Git I have InstantRails installed and
running git instaweb in my repository opens a page that says 403 Forbidden -
In a previous Git question , Daniel Benamy was talking about a workflow in
I'm a Git beginner with workflow questions. I've learned lots of commands, and I
I am a beginner in C. While reading git's source code, I found this
Git has the very handy archive command which allows me to make a copy
Git/Mercurial have been becoming more and more popular. I have seen plenty of articles
$ git --version git version 1.7.0.3 I clone an SVN repository, and make a

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.