First GIT add of old system

I have an old ASP 3.0 system that I want to move into a GIT repo. Currently the most complete version of this system is the production system, so that's what I want to start with.

Should I make a copy of the system and then push the copy to git, then erase the old system and then checkout the new production system from git? Or is there some other way that I haven't thought of that is better?

Answers


Create a Git repository where the production system is (git init .), add files (git add .) and commit (git commit -am "Initial commit from live") , then git checkout -b live to call that branch live (and master), add a bare repos as origin (git add remote origin git://server/new_bare_repo.git) and push there (git push origin master ; git push origin live).

This would get you a "live" branch which reflects what is currently in production, and a master branch which you use as basis for development.

From then onwards, use the new bare repo for development, on the master branch.

Whenever you want to make something live, make changes (merge, cherry pick, whatever) on the live branch from the master branch or other feature branches, and push the new live branch to the "new bare repo's" live branch. Then go on the Git repo on production and git pull --rebase origin live, and git push origin live.

Your bare repo then will always have:

  • a "live" branch pointing to whatever is currently deployed
  • a "master" branch containing your development

Your production checked out version will always have:

  • whatever you wanted to be live

Hope that helps


Should I make a copy of the system and then push the copy to git, then erase the old system and then checkout the new production system from git? Or is there some other way that I haven't thought of that is better?

Yes, that would work. Instead of removing the old directory, I'd suggest renaming it; and after you've checked it out from the GIT repo, do a recursive directory comparison of the new and the old (renamed) directory. If they match (except for the .git subdirectory, which you can ignore), than you can remove the old (renamed) directory. But for extra safety, wait a couple of weeks with removal -- maybe the file permissions in the new directory aren't right in the new directory, so if you get an error message about that, then you'll have the old directory to look up and copy the permissions from.


Need Your Help

How to push UIViewController with replaced UINavigationController

iphone ios uiviewcontroller uinavigationcontroller uinavigationbar

I have a custom UINavigationController that draws a custom background. That navigation controller is already set when accessing self.navigationController on the root view controller. Now what I'd l...

Extract last line of very long txt file

python python-2.7

I have a very long file containing data ("text.txt") and a single file that contains exactly 1 line that is the last line of text.txt. This single line should be overwritten every 10 minutes (done ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.