Git: automatic backup of all commits when creating

There is something that I want. I hope that it exists, and if it is not, I can create it. I will describe it, and if you know something like this, please let me know. If not, and you have pointers on how to create it, I will appreciate it too.

I have been using Git for my projects for many years, but only now I started working in a large repo company, for which 100 developers are committed. When I worked alone and in small teams, I used to make many commits all the time, placing all the files and using an empty commit message (yes, this is how I roll.) I mainly used commits as an extended save operation; every time I entered a non-trivial amount of code, I did all this and translated it into a non-leading branch.

Now that I work in a large company, I can’t do this because it will be unpleasant for other people. Therefore, I still often make frequent, undocumented commits, but when I finish, I squash them all by reloading them, give them a nice informative commit message and send a merge request with just that. All my temporary obligations will be deleted the next time the garbage collection starts.

I don't like the way all of my interim commits are deleted. They may be ugly, but I love them. Sometimes they have a bit of code that I wrote and then deleted, and I don’t want to lose this code. I might need it again in the future.

Now I can put all these commits in a private branch. But creating and maintaining such a set of branches will be unpleasant. Because this means that for each function branch, an additional auxiliary branch will be required, which will remain open and without strength forever. Ugh.

I want a system that saves all the commits made in Git and ensures that it remains available for the foreseeable future. It is important for me that this is automatic, without the need to take any action. I want to know that I can return to any excellence that I have done, even if it was lost in squash.

Is there something similar? Any pointers to creating it?

+4
source share
1

- , .

, - ( ​​/), "current_branch_1" (_2, _3...) , .

, ( rebase/reset, reflog).
, - "" .

+1

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


All Articles