0

I have a few git projects where I clone them and start off with another project based on it. For example, I'll have CodeIgniter set up in my own way (adding htdocs, a conf/ directory with some apache files I can softlink to, etc).

It's somewhat like this:

git workflow - using one repo as the basis for another

So I can clone, then clean off the .git directory, then init, add, commit, clone --bare and scp to the server. That works but it seems like I should be able to do that easier.

So I tried clone, then git remote rm origin then git remote add origin ssh://... but I still had to go to my server, create the repo directory and init. This also created the repo in .git instead of just in the top level of the directory (which --bare apparently does).

Am I missing an easier way to do this?

Thanks, Hans

Community
  • 1
  • 1
Hans
  • 3,403
  • 3
  • 28
  • 33
  • It's worth noting that these two ways are very different - the first way deletes all history, but the second way keeps it all. – Robin Green May 26 '11 at 16:58

1 Answers1

0

I did not find a way to do this, but I do have a personal git repo where lives a complete customized bare repository. I just have to take these steps:

  1. clone
  2. cd dir && rm -rf .git && git init && git add . && git ci -a -m '1st commit'
  3. git add remote origin ssh://user@server.com/path/to/git/repo
  4. cd .. && git clone --bare dir dir.git && scp dir.git user@server:/path/to/git/repo

I've documented in my vimwiki and it's not the end of the world (in fact, I can kickstart an entire dev project on my localhost in 60 seconds and be doing everything from DB work at that point).

Hans
  • 3,403
  • 3
  • 28
  • 33