Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Push event revocation steps for git version management

Shulou Source: shulou.com Published: 2022-06-02 07:49:52 09月24日 Update

This article mainly explains the "git version management push event revocation steps", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "git version management push event revocation steps"!

Abstract

In the Internet projects of    a few years ago, people often use svn for version management. With the continuous optimization of git and the evolution of Internet architecture model, git is more and more favored by developers. Several projects that    bloggers have experienced have also used git as the version management of the project. After most of the projects are initialized, dev and test branches will be added to facilitate the management of the development code (some projects will also set up more branches to manage). In general, we all require developers to only allow commit and push operations of the code in the dev branch. Of course, sometimes you can't avoid someone who is not afraid to push code in test or other non-dev branches. The blogger experienced such a thing in his previous company, when there were still many branches of our project (don't ask me why I opened so many branches, as requested by Party A), and made a mess several times after being mistakenly pushed the code by new colleagues. In this article, let's solve this problem.

Undo step (assuming the code was mistakenly pushed in the test branch)

1-> git log

Check your submission record and find the last version number.

2-> git reset-- soft

Parameter soft refers to: keep the current workspace, so that resubmit can also select the parameter hard, will undo the changes to the corresponding workspace, must be used with caution

3-> git push origin master-f

After fallback, push the pre-commit code to the remote branch

4-> done.

Thank you for reading, the above is the content of "git version management push event revocation step". After the study of this article, I believe you have a deeper understanding of the push event revocation step of git version management, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Management branches versions code steps projects events learning development Internet people content parameters workspaces more articles questions interconnections work push Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple vpn Huawei NVidia Shulou Information