Git - save work without commit

I'm new to the git world, I want to ask how to solve my workflow problem, basically I have 2 computers, one in the office and one in the house, and I also have vps working as my git shared repository. When I work in the office, I have incomplete code and I want to continue my work at home, so I usually take over the work in the office and push my work to the general git repository, after which I will return to home and continue with it.

But sometimes I just didn’t return home, and in the meantime, one of my employees pulled out the code and worked with it, and he simply yelled at me because I had committed a broken code. So my question is: how can I change my computer without committing, but am I still getting my work in progress?

+5
source share
4 answers

Do all your work in your branch, let your colleague know what not to pull from this branch. This can become messy if you have many developers, but with two people this should not be a problem at all.

+11
source

When I work on a project more, I use my branch. Therefore, if I have a code that is not finished yet, I commit it and paste it into my branch. When I think this code is ready for use, I pass it to the general working branch. After testing here, we will combine it with the lead branch.

Example:

Workshop branch: Tested by everyone. WIP branch: general work in the industry, branch, everyone can use the code and verify it. WIP-Bright: my branch is WIP-someone: a branch of someone else.

git cheatsheet git.

+2

, . , ( git format-patch), ( git apply)

, git commit --amend "" , , .

0

, (. " " git push " , ? ' GitFaq Git Wiki), " ", excahnge , git bundle, (sneakernet) .

, , .

0

All Articles