In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
The knowledge of this article "how to correctly prepare Git submission message" is not quite understood by most people, so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to correctly write Git submission message" article.
I think we all have this experience:
You are developing a project that uses Git for version control.
You have just made the changes and want to update the branches quickly.
So you open the terminal and update the remote branch with your changes with some quick commands.
Git add.
Git commit-m "added new feature"
Git push
But then you do some tests and find that bug exists in your code.
Don't worry, you can quickly find a solution and submit it again to solve the problem.
Git add.
Git commit-m "fix bug"
Git push
You repeat this process several times, and now you end up with a git commit log, as shown below:
At the moment, this seems good for you, after all, you are currently working on that part of the code, and even if the submitted message does not convey your intention to change, you can easily explain what has been done.
problem
Months have passed, and now another developer is reviewing your changes.
They try to understand the details of your changes, but because the message you submit is not descriptive, they cannot get any information.
Then they try to see the differences for each submission. But even if they do, they are still not sure about the thinking process behind your choice in implementation.
So they can use git blame to find out who made these changes and start asking you questions about the implementation.
However, since time has passed for a long time, you won't remember much. You check by submitting, and you no longer remember the logic behind implementing decisions in the project.
In the end, you sent sad emoticons to your colleagues on Wechat and told them you couldn't provide more information than they knew.
I hope the above has shown you why it is important to write good git commit messages.
In team development, we must make it easy for other collaborators to understand what we are doing.
Ideally, a good submission message would be divided into three parts: the subject, the body, and the ending.
Theme
The theme should be a concise line that summarizes the changes you have submitted.
The following is an example of a good submission information, such as "feature: query project application rate function".
An incorrect submission message, such as "fix bug", is overwhelmed when others see the submission message.
Text
The text contains the message you want to convey, in which you can learn more about the changes. Please note that for small submissions, such as correcting typos, you may not need the text because the subject line should be informative enough.
In the text, you should have an in-depth understanding of the changes being made and explain the causes and consequences of the actions being performed.
You can explain why you made these changes, why you chose to implement them in this particular way, and any other reason that can help people understand the thought process behind your submission.
Try not to repeat the obvious things in the comparison code, instead of explaining your changes line by line, focus on covering more advanced details that may not be obvious from reading the code. The ultimate goal is to provide context around this change to the development process, which is primarily related to its causes and goals.
The above is about the content of this article "how to correctly write Git submission message". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.