However, if you do it the other way around: And the upstream remote doesn't have any other remotes in its configuration. Then git sets up the configuration in 'original_repo' with this relationship: original_repo origin -> /outside_of_any_repo/my_remote.git/ Git remote add origin /outside_of_any_repo/my_remote.git If you create the bare repository like this: There is an interesting difference between the two popular solutions above: Now you’re ready to collaborate on the same project. It is very easy to take a Git repository, create a bare version, and place it on a server to which you and your collaborators have SSH access. Git will automatically add group write permissions to a repository properly if you run the git init command with the -shared option. You can set up your new repository by copying your bare repository over: $ scp -r my_project.git this point, other users who have SSH access to the same server which has read-access to the /opt/git directory can clone your repository by running $ git clone a user SSHs into a server and has write access to the /opt/git/my_project.git directory, they will also automatically have push access. Let’s say you’ve set up a server called that you have SSH access to, and you want to store all your Git repositories under the /opt/git directory. Now that you have a bare copy of your repository, all you need to do is put it on a server and set up your protocols. This command takes the Git repository by itself, without a working directory, and creates a directory specifically for it alone. Initialized empty Git repository in /opt/projects/my_project.git/ git, like so: $ git clone -bare my_project my_project.git By convention, bare repository directories end in. In order to clone your repository to create a new bare repository, you run the clone command with the -bare option. In order to initially set up any Git server, you have to export an existing repository into a new bare repository - a repository that doesn’t contain a working directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |