visual studio 2019 - publish a web app that uses git publish the .git folder

Dani Kaplan 61 Reputation points
2021-10-27T14:06:00.82+00:00

I have a web site developed in visual studio and SC is GIT.
when I publish the website to a folder - it is also publishing the old .svn and the new .git folders.
is there a way to tell publish to ignore these folders ?

Developer technologies | Visual Studio | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. PengGe-MSFT 3,381 Reputation points
    2021-10-28T07:16:20.78+00:00

    Hi, @Dani Kaplan

    Welcome to Microsoft Q&A!

    What type of your project? I created an ASP .NET Core project and published it to a folder. The .git folder in the solution folder was not published to the folder.
    You can refer to Exclude files and How to: Exclude files from the build.

    Sincerely,
    Peng
    *
    If you have extra questions about this answer, please click "Comment". If the answer is the right solution, please click "Accept Answer" and kindly upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Dani Kaplan 61 Reputation points
    2021-11-17T12:44:27.757+00:00

    this is an old asp.net (dot net framework) project.
    used to be on TFS, now on GIT and i have both .svn and .git folders published when I deploy the project to a folder...

    Dani

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.