我们可以推送我们的代码 GIT 功能分支吗?

Can we push our code GIT feature branch?

我们正在遵循提到的 GIT 分支策略 here

我们正在从开发创建功能分支,并致力于新功能。

我们想将代码存储在功能分支中,该分支目前正在开发中以节省我们的日常工作。

GIT 分支策略没有提到任何关于将代码推送到功能分支的具体内容。

我这里需要专家的建议,我们可以做吗

git push origin feature/feature_branch_name

在每天结束时,保存我们的 WIP(有时尚未测试)代码?

请告诉我,是否有任何其他最佳实践可用于存储功能代码开发。

这正是使用分支的概念——无需在当前分支上工作即可开发新代码和修复错误。

这是正确的工作方式,您理解正确。


git branch

A branch represents an independent line of development.

Branches serve as an abstraction for the edit/stage/commit process discussed in Git Basics, the first module of this series. You can think of them as a way to request a brand new working directory, staging area, and project history.

New commits are recorded in the history for the current branch, which results in a fork in the history of the project.


In Git, branches are a part of your everyday development process.

When you want to add a new feature or fix a bug —no matter how big or how small—you spawn a new branch to encapsulate your changes.

This makes sure that unstable code is never committed to the main code base, and it gives you the chance to clean up your feature’s history before merging it into the main branch.