Processing of Git Repository URLs During a Synchronization
The following describes how SCM synchronization handles repository URLs identified in an SCM Git instance.
Codebase Structure on the Scan Server
All repositories for a single instance (Git, Perforce, Subversion, or TFS) are synchronized to the following location on the Scan Server:
<scanroot>/<projectID>/<scm_instance_ID>
where <scanroot> is the Scan Server root directory, <projectID> is the ID of project for which you have added or edited SCM instances, and <scm_instance_ID> is the internal ID for the SCM instance, such git.0, git.1, and so forth.
For a Git instance, each different repository identified in the instance is synchronized to a separate folder under the <scm_instance_ID> folder on the Scan Server. The folder name is based on the repository name in the URL. For example, suppose the following URLs are provided in the same instance:
https://github.com/scaqaadmin/scagit_prime1.git~~main
https://github.com/scaqaadmin/testgit_fnci>>217b44c0eb2b47bb43e22772ef109711ee5cfb3a
The two repositories are synchronized to the following respective locations on the Scan Server, where C:\CodeBase is the Scan Server root directory, 3388 is the project ID, and git.0 is the SCM instance ID:
• | c:\CodeBase\3888\git.0\scagit_prime1 |
• | c:\CodeBase\3888\git.0\testgit_fnci |
Synchronization of Multiple URLs for the Same Repository
The synchronization process maintains only one folder per Git repository on the Scan Server. If multiple URLs in an instance identify the same repository (but, for example, point to different branches, tags, or commit IDs within the repository), the synchronization retains the codebase for only the last URL listed for the repository in the Git Repository URL(s) field.
For example, suppose the following URLs are listed in this order in the Git Repository URL(s) field for an SCM Git instance. Each of these URLs identify the same Git repository, testgit_fnci, but point to different views of the repository:
https://github.com/scaqaadmin/testgit_fnci~~main
https://github.com/scaqaadmin/testgit_fnci>>217088
https://github.com/scaqaadmin/testgit_fnci~~nuget
The synchronization processes these URLs sequentially, overwriting each preceding codebase in the testgit_fnci folder on the Scan Server until the codebase for the last URL listed for testgit_fnci (in this example, https://github.com/scaqaadmin/testgit_fnci~~nuget) is synchronized. This is the codebase that is retained in the testgit_fnci folder on the Scan Server. (Any files common among each of the overwritten codebases are retained in the final synchronized codebase.)