When managing Git, if you don't want to submit the version before editing is complete, you have to change computers. what to do?
曾经蜡笔没有小新2017-05-24 11:35:49
0
6
935
Using git archive can only export submitted versions. Unsubmitted ones will not work. . After submission, export and then return to the previous version? How should we do better?
Git is not svn. Git can develop with multiple branches, why can't it be submitted? Normal project management has at least one main branch and one release branch. Each developer has his own independent branch. After submission, it will be merged into the main branch after review by the specialist.
Cut a branch to store your modifications. You can submit the modified parts to this branch, change the computer and pull it down to continue development. After development, submit it to your own version library. Just delete your temporary branch after use
1 Install the hard disk on the new computer 2 If the old and new computers can be used at the same time for a while, commit locally first, open the server on the old computer or use network sharing to share your code library, and clone the library on your old computer on the new computer. . 3 Create a new temporary branch and push it to the public server. After cloning on the new computer, delete the temporary branch on the public server.
It is recommended to use the method above. Git is inherently distributed development. The cost of establishing a branch is very cheap. You can create branches at will.
Give lz my method. This solution is not mainly for changing computers, but for not wanting to submit imperfect commits. lz just wants to make the commit content more comprehensive. amend can solve it perfectly. This command is used to modify commit information
In this way, you can submit it locally at any time. Each subsequent submission will modify the previous submission. When you are finally satisfied, push it to the remote. For lz's situation, there is another point to note. After the first computer pushes and the second computer pulls&&--amend, the local commit and the remote commit are already different. At this time, you need to delete the remote branch and push it again. There are two methods
Step 1: Pull a temporary branch
Step 2: Submit on the temporary branch
Step 3: Change the computer and checkout the temporary branch
Step 4: You can delete the abc branch
Git is not svn. Git can develop with multiple branches, why can't it be submitted? Normal project management has at least one main branch and one release branch. Each developer has his own independent branch. After submission, it will be merged into the main branch after review by the specialist.
Cut a branch to store your modifications. You can submit the modified parts to this branch, change the computer and pull it down to continue development. After development, submit it to your own version library. Just delete your temporary branch after use
1 Install the hard disk on the new computer
2 If the old and new computers can be used at the same time for a while, commit locally first, open the server on the old computer or use network sharing to share your code library, and clone the library on your old computer on the new computer. .
3 Create a new temporary branch and push it to the public server. After cloning on the new computer, delete the temporary branch on the public server.
It is recommended to use the method above. Git is inherently distributed development. The cost of establishing a branch is very cheap. You can create branches at will.
Give lz my method. This solution is not mainly for changing computers, but for not wanting to submit imperfect commits.
lz just wants to make the commit content more comprehensive. amend can solve it perfectly. This command is used to modify commit information
General usage:
In this way, you can submit it locally at any time. Each subsequent submission will modify the previous submission. When you are finally satisfied, push it to the remote.
For lz's situation, there is another point to note. After the first computer pushes and the second computer pulls&&--amend, the local commit and the remote commit are already different. At this time, you need to delete the remote branch and push it again. There are two methods