Work with Git and Visual Studio

For people working on the C++ code.
Post Reply
glut32
New member
Posts: 5
Joined: Wed Feb 01, 2017 09:46
IRC: glut32

Work with Git and Visual Studio

by glut32 » Post

Hi all,

I would like to work on the Minetest's engine with git and Visual Studio. And when I use CMake, I have a generated project in another directory. The problem is to use (tortoise)git with another directory than the original (from git). When I want to update my source code, I would like to update my generated project instead the original root directory cuz I modify the source code of the generated project. And I don't to generate a new project after to updated the root (git)..

ps: the generated project compiles and run well with visual studio 2015

glut32
New member
Posts: 5
Joined: Wed Feb 01, 2017 09:46
IRC: glut32

Re: Work with Git and Visual Studio

by glut32 » Post

It's ok for me. CMake doesn't generate or copy the source code but only generate directory with some visual studio projects.

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Work with Git and Visual Studio

by Krock » Post

It's easy. Here's how I do it: (Also with TortoiseGit and MSVC, of course)

1) Configure the project with CMake and set the build directory to a path outside the git directory
2) Create a new branch for your future changes
3) Start VS2015 or any other editor and do your changes, compile, whatever
4) Commit the changes, once they're done
5) Easily switch back to the master branch, update it to have the official Minetest version too

This way you'll only need one Git clone and one build directory, which can save you over a Gigabyte of data. The negative point about this is, that all affected files in the branch switching must be re-compiled, so it might take a bit longer than if you had two seperate git and bin directories.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests