How to work with local / dev only code using git

if I have local debug code or development web services in my sources, I want me to carry medium and long-term local information, but I don't want this in my git repository, what is the best way to accomplish this?

while I just leave it alone, partially transfer partial files, avoiding these lines, and do a series

git stash git pull --rebase git stash pop 

when there are divergent changes, etc.

Assuming that I cannot or do not want to change the structure of the code to output these lines to a file that can be included and / or ignored, how do you deal with this type of situation?

local changes to the Makefile are discussed here, which is similar to the main idea I want, but most of the suggestions are on how to get around it, and not in a very satisfactory way.

I think I'm looking for something like .gitignore for a set of changes.

+4
source share
2 answers

One option is to just keep a separate branch in your server-side repo copy that you never published publicly, and your local changes. You can combine material upstream in this thread; until you merge this branch into a branch up, these changes will never appear again.

Another option is that you can disable these settings in a configuration file that you donโ€™t test on Git at all.

+2
source

Ideally, you should put the changes in a branch and reinstall the changes on top of the main development tree.

If for some reason you really do not want to create objects in this git database even in a separate branch, then consider cloning your repo into another directory in which you only registered private changes. Then you can pull and reinstall there, without worrying about the objects crawling into the original repo (which, I suppose, you can scare, might accidentally get a jolt).

+1
source

Source: https://habr.com/ru/post/1400073/


All Articles