简体   繁体   English

GIT-如何创建一个新分支来重构整个项目

[英]GIT - How to create a new branch to refactor an entire project

I have an ios project that i would like to restart from scratch. 我有一个ios项目,我想从头开始。 I want to do that into a new branch from the git repo. 我想从git repo到一个新的分支。 I don't really know how to proceed. 我真的不知道该如何进行。 I've created the new branch and a new project in xcode. 我在xcode中创建了新分支和新项目。 But now i would like to version the new project in my new branch. 但是现在我想在新分支中对新项目进行版本控制。

Thanks! 谢谢!

如果为此使用Xcode,只需转到“ Source Control/Check Out...选择新的分支,然后选择“ Source Control/Commit...Source Control/Commit...的更改和“ Source Control/Push... ,那么您应该一切顺利!

Clone your repo. 克隆您的仓库。 Then reset your HEAD to the commit you want to start from now create new branch and push it to remote.. 然后将您的HEAD重置为您要从现在开始的提交,创建新分支并将其推送到远程。

eg 例如

 git clone project

 git reset --hard CommitID

 git checkout -b newbranch

 git push origin HEAD:refs/heads/newbranch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM