The usual git workflow is to create a new branch where the new feature can be written in isolation without disturbing the existing code until it has been properly debugged, tested, approved for release etc. Only after all that has happened, then it can be merged with the main branch of the existing code. So: git branch [newfeaturename] git checkout [newfeaturename] ...write code, test code etc... git checkout main git merge [newfeaturename]