How to use a recurring Integration Endpoint for importing data
You are here
Using Git in PackagesLocalDirectory - VS 2019 Edition
Using Git in PackagesLocalDirectory - VS 2019 Edition
This article is an update of this post to show how to use Git in PackagesLocalDirectory when using Visual Studio 2019.
Open VS 2019. Open the Team Explorer tab then click on "connect" for Azure DevOps.
Connect to your Azure DevOps Project
Next, Clone the repository.
Review settings and click "Clone". Note locations used for later.
Click Clone.
Next, close Visual Studio and install Git from https://git-scm.com/download/win accepting the defaults if you're uncertain what the installer is asking you.
Next, Open PowerShell as an admin to run the following commands. Update the paths to what is appropriate for your scenario first.
#Update for your VM / environment
Copy-Item "C:\Users\Admin2dacea367e\source\repos\ABC Business Company Incorporated\.git" "K:\AosService\PackagesLocalDirectory\" -Recurse#Update for your VM / environment
cd k:\AOSService\PackagesLocalDirectory\git reset --hard
Get-Acl -Path k:\AOSService\PackagesLocalDirectory | Set-Acl -Path k:\AOSService\PackagesLocalDirectory\.git
#Update for your VM / environment
Remove-Item "C:\Users\Admin2dacea367e\source\repos\ABC Business Company Incorporated" -Recurse -Force -Confirm:$false
Next, update the .gitignore file is K:\AosService\PackagesLocalDirectory\ to exclude everything that isn't an extension. This may be optional depending on the state of your repo and .gitignore file. Update the paths for your specific scenario first and add at the end of the file
# F&O specific
# Ignore everything
/*# But keep custom package and models for Package "ABC Business Company Incorporated"
# This will capture all models the descriptors for the package
# ABC Business Company Incorporated
!/ABC Business Company Incorporated
# bin isn't required in source control, it'll be created/updated during build if needed
ABC Business Company Incorporated/bin/
# resources isn't required in source control, it'll be created/updated during build if needed
ABC Business Company Incorporated/resources/
# XppMetadata isn't required in source control, it'll be created/updated during build if needed
ABC Business Company Incorporated/XppMetadata/
# All other logs or build outputs are not needed in source control
ABC Business Company Incorporated/*.xml
ABC Business Company Incorporated/*.log
ABC Business Company Incorporated/*.txt
ABC Business Company Incorporated/*.xref
ABC Business Company Incorporated/*.$usr# Also keep any binary package that may be in source control for binary package "Binary Company"
# this will keep all files and folders with files in folder "Binary Company"
!/Binary Company# keep VS Projects in PackagesLocalDirectory\Projects
!/Projects# Also include the following files in root of PackagesLocalDirectory
!.gitignore
# YAML Pipeline for DevOps
!azure-pipelines.yml
# settings for NuGet for Pipeline
!nuget.config
# packages references for NuGet for use in Pipeline
!packages.config
Open VS 2019 again. Click Continue without code.
Next, click on the Git Menu, Local Respositories then Folder...
Next, select you PackagesLocalDirectory folder, typically either K:\AosService\PackagesLocalDirectory or C:\AosService\PackagesLocalDirectory.
Click on the Git changes tab if you are not taken there automatically. Here we can see our changes to the .gitIgnore file.
From here, we'll need to refresh models, then build the ABC Business Company model in this example. We can now develop as normal as if we were using TFVC and we shouldn't notice any major differences with the development experience.