gitignore - Ignore line of code in Git -


in project ignore single line of code, because contains directory different every user of repo.

i have found a useful answer problem, don't know how apply own problem.

the line need ignore follows: mymesh.loadmesh("d:/software projects/opengl/raytracing-project/dodgecolortest.obj", true);

so know have insert in $ git config filter setting, both clean , smudge case.

the standard solution problem move string configuration file , add file .gitignore. also, put renamed copy of file repository explanation how use it.

the format of configuration file , way use depend on language using.


for c, c++ , similar languages can simple .h file contains along these lines:

/**  * file contains various constants (paths, example) specific  * computer code compiled.  *  * make copy of file 'config.h' , change match system.  */  #ifndef __config_h__ #define __config_h__   /* path obj file used blah-blah-blah feature */ #define obj_path "d:/software projects/opengl/raytracing-project/dodgecolortest.obj"   #endif 

name config.h.dist (or use name more appropriate project , coding style) , add repository.

make copy of config.h , add config.h .gitignore.

put #include "config.h" file extracted code above , replace concrete file path symbol defined in config.h:

#include "config.h"  mymesh.loadmesh(obj_path); 

use technique extract code config.h values may different on systems of workmates. don't forget add them config.h.dist too, relevant description types , values may have.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -