![]() ![]() gitmodules: No such file or directory From cygwin. You'll want to change the remote URL of this module directory to your new submodule repository, which is typically named "origin. /foo/bar 'foo/bar' already exists in the index > cat. This will let you transfer over all the Git history related to that submodule. You'll be left with only the code that was in the directory, and only the commits pertaining to it. Go to Finder and navigate to the folder that contains the files. Step 3 Drag The Files Into Your Xcode Project. En este ejemplo, agregaremos una biblioteca llamada DbConnector. git submodule add yourGitHubReposSSHkey It may prompt you for your passphrase. Para agregar un nuevo submódulo, use el comando git submodule add con la URL del proyecto que desea empezar a rastrear. Git filter-branch -subdirectory-filter submoduledirectory -all Comencemos agregando un repositorio de Git existente como un submódulo del repositorio en el que estamos trabajando. This is a destructive operation, so make sure you're doing this on the copy of your repo, not the main one. This will delete all the commit history that isn't related to the code contained in the submodule. Next, you will want to filter out everything that isn't related to your submodule. Next, you will want to get a fresh copy of your main repository to make the submodule repository from. This is usually on a Git hosting service like GitHub, though you can create a local repository on your computer. The first step is to create a new repository for the submodule. Submodule support includes support for adding. This file contains which paths are submodules and what URL should be used when cloning and fetching for that submodule. gitmodules file located at the root of the parent repository. Instead, we'll clone the repository, filter out the unneeded code, and push the new history to the new submodule. A submodule can be located anywhere in a parent Git repository’s working directory and is configured via a. ![]() You can copy the code to a new folder, but you will lose all the Git history related to it, which can be very detrimental in large projects. Git expects you to create a new empty directory for it, and clone the submodule into the project. One of the main problems with turning an existing directory into a submodule is that the submodule should be managed externally. However, this doesn't work for all types of projects, and if you're working with private code, you'll need to set up a private package registry, which can be more complicated than simply embedding the library's source code as a submodule. This means that the submodule's code and Git history is kept separate from the main version control, and can be updated for multiple repositories that consume the library.Īn alternative to submodules is to publish your libraries as packages to package managers like NPM, Maven, or NuGet. When you clone the parent repository, it automatically clones the submodule repository as well.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |