0

I have my working copy on my local machine named foobar. Therein are all my files including the .git folder with all the information about commits and so on.

My question is how can I create a file/folder named foobar.git from this folder to import it anywhere like GitHub, BitBucket, .. ?

pregunta
  • 138
  • 1
  • 11

1 Answers1

3

This kind of folder is called bare repository. You can create a new bare repo with git init --bare foobar.git and push to it from your repository or pull to it. Or you can clone it from your repository:

git clone --bare /path/to/foobar

The command creates a bare repo foobar.git and clones commits, branches and tags from foobar.

But for importing your history to remote repositories you hardly need such a bare repo. You just create a new repository via web-interface, clone it or add a remote to an existsing repo and push to it.

phd
  • 82,685
  • 13
  • 120
  • 165