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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:55:04+00:00 2026-06-12T03:55:04+00:00

I have several backup dirs I want to put them into git. The dirs

  • 0

I have several backup dirs I want to put them into git.

The dirs are:

web_backup_2012-03-07
web_backup_2012-06-03
web_backup_2012-06-21
web_backup_2012-06-25
web_backup_2012-07-02
web_backup_2012-07-15
web_backup_2012-07-21

now I want to put them on git. What’s the best way?
(each backup is about 1.1 G, 20k files.)

Here’s what I think should do:

• cd to the earliest backup dir.

git init
git add .
git commit . -m"initial commit"

then move the .git dir into the second dir, then do

git add .
git commit . -m"commit. ‹date here›"

repeat the above.

Then, when in the last dir, I’m done. I can delete all previous backup dirs. (I can then move the .git dir into my current working web dir and repeat. So that my web dir with history is all in git now.)

From my test, each step will take 10 minutes.

I am new to git. Plus is if anyone can tell me whether/how to also add a tag of date (if it is good for this.)

Is there a better way?

  • 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-12T03:55:06+00:00Added an answer on June 12, 2026 at 3:55 am

    Rather than git add ., which will always add files, I recommend git add -A which will “find new files as well as staging modified content and removing files that are no longer in the working tree” (from the git docs).

    I’d write a script that looks something like this:

    #!/bin/bash
    git init
    GIT_DIR=$(pwd)
    for dir in $(find . -maxdepth 1 -name web_backup_\* | sort); do
      pushd $dir
      git add -A
      git commit -m "Backup for $dir."
      git tag $dir
      popd
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several xml files with different node structure. I want to extract xml
I have several xml files that are formated this way: <ROOT> <OBJECT> <identity> <id>123</id>
we have several tens of macro enabled excel files, each of those contains few
I have several Select which depend on each other if I select a value
I have several threads which act as backup for the main one spending most
I have several UITextField objects on a view. When I press on them, I
I have one bat file on windows7, for backup several tables from my database,
I have set up several Views each containing a UIPickerView each of which contains
I have several C programs that contain comment line at the beginning of each
I have several old 3.5in floppy disks that I would like to backup. My

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.