From Genome Analysis Wiki
Jump to navigationJump to search
744 bytes added
, 18:07, 14 July 2011
Line 1: |
Line 1: |
| + | == Turn an already existing directory into a Git Repository == |
| + | |
| Its easy to turn an already existing directory into its own repository. | | Its easy to turn an already existing directory into its own repository. |
| | | |
Line 14: |
Line 16: |
| | | |
| | | |
− | Follow this link if you want to [[Create a remote bare Git repository for a repository to push to/pull from|create a remote bare Git repository for this repository to push to/pull from]]
| + | Continue to the next section if you want to create a bare repository for it to push to/pull from. |
| + | |
| + | == Create a remote bare Git repository for a repository to push to/pull from == |
| + | |
| + | # cd to where you want the remote repository located. |
| + | # Create the bare repository. |
| + | #* <code>git init --bare --shared ''bareRepoName''</code> |
| + | # cd to your repository that you want link to this bare repository. |
| + | # Set the remote. |
| + | #* <code>git remote add origin ''path to/url for your bare repository''</code> |
| + | # Set the configuration for pulling. |
| + | #* <code>git config branch.master.remote origin</code> |
| + | #* <code>git config branch.master.merge refs/heads/master</code> |
| + | # Push your files to the bare repository (must specify origin master since this is the first push to the empty repository) |
| + | #* <code>git push origin master</code> |
| + | |
| + | You can now operate as if you had cloned from bareRepoName. |