Work with Git and Visual Studio

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

Work with Git and Visual Studio

by glut32 » Wed Feb 08, 2017 11:01

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 » Wed Feb 08, 2017 14:48

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: 3763
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: Work with Git and Visual Studio

by Krock » Thu Feb 09, 2017 20:13

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.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 


Return to Partly official engine development



Who is online

Users browsing this forum: StoneSoldier and 2 guests