1

I am dealing with a project which was moved to GitHub repo with some major updates in the project base. But those who work on same project base has only the non updated version. So how to convert their local non-git repo to local git repo and update them with new version of the same project.

I have gone through all documentation of git and still I am not clear

Sathish Kumar k k
  • 1,732
  • 5
  • 26
  • 45

2 Answers2

1

To keep their work, the best way would be:

# current dir is ~/oldversion
# create a new directory 
mkdir ~/newversion
# get the clean versioned project
git clone git@github.com:Your/repo .
# create a new local branch and go on it
git checkout -b migration
# now copy everything from the old project. the modified files will appear with "git status"
cp -r ../oldversion/* ./
# commit the last work
git commit --all -m "importing to git"
# now, make some checks/editio, git diff, git rm, git revert, git checkout path/to/file whatever
...
# then import your work in a branch for everyone, if you use master that means
git checkout master
git merge migration --no-ff -m "migrated by me"

If a scm was used, you may prefer to exclude some files at one point, like the .svn directories.

Asenar
  • 6,732
  • 3
  • 36
  • 49
0

One way would be to:

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • But the project drive size is 24GB and so `git add .` says `fatal: confused by unstable object source data for 5ff6461b50272925aa5481de381f9797bb2784bf` – Sathish Kumar k k Jan 24 '13 at 09:41
  • @SathishKumar does the GitHub project have also 24GB of data? If not, that means you need to define in a.gitignore file what you don't want to version, and add only the sources. – VonC Jan 24 '13 at 09:46
  • It is of 300MB size, since it is a base and not the whole project. – Sathish Kumar k k Jan 24 '13 at 09:55
  • @SathishKumarkk but surely you don't have 24GB of *sources*? Git is a *source* control only. – VonC Jan 24 '13 at 10:21
  • 24GB I mention for my local project size and not the github's repo – Sathish Kumar k k Jan 25 '13 at 08:23
  • 1
    @SathishKumarkk ok, anyway you need to carefully write your `.gitignore` file in order to version only what you need (and not what could be generated) – VonC Jan 25 '13 at 08:25