2

I'm working on a project now, and sometimes I need to finish it on another computer. When using GitHub in vs2019, the configuration file a .vcxproj file of the project will also be uploaded, which makes me unable to directly pull the code on another computer. The two computers use different disks in OpenSSL library, which leads me to manually adjust the include option after each pull code.

Is there any vs2019 configuration method (not directly changing the .gitignore file) that can only upload .h files and .cpp files without uploading .vcxproj files. I right-click the file in the GitHub window of vs2019, and there are no related options.

mikami
  • 43
  • 4
  • just create a `.gitignore` file (or append to it if already exist), containing a new line `.vcxproj` – Kristian Mar 30 '21 at 06:31
  • I think you could find the solution here https://stackoverflow.com/questions/936249/how-to-stop-tracking-and-ignore-changes-to-a-file-in-git – asbrodova Mar 30 '21 at 07:16

1 Answers1

0

Is there any vs2019 configuration method

Not that I know of

not directly changing the .gitignore file

Your best bet is to clone/checkout the project through Git command-line, then switch back to VSCode.

You could therefore use git sparse-checkout (with an exclusion rule) in order to not load any *.vcxproj.
Ful details on this experimental command here (Use Git 2.26 at minimum, preferably 2.31.1)

For example, run:

git clone --no-checkout /url/repo
cd ./repo
git sparse-checkout init
git sparse-checkout set /* !*.vcxproj
git sparse-checkout list
/*
!*.vcxproj

git read-tree -mu HEAD
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250