- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我是 GIT
和 GIT-Flow
的新手。 [在我的 python-django 项目上]
我做了什么:
git flow feature start new_feature
# perform some commits on the feature/new_feature branch
git push origin feature/new_feature
git flow feature finish new_feature
# I suppose that merges feature/new_feature to develop and deletes feature/new_feature
git push origin develop # Pushes the new changes to remote
问题:
github
[我的远程命名来源] 上我可以看到分支功能/new_feature。git flow
那么,你们每次使用 git-flow
时都必须从所有远程删除所有功能分支吗??
我做错了什么吗?
最佳答案
如果您曾经做过 git push origin
(feature
在本地 check out ),请知道当前的默认推送策略是 default。
这意味着 ( git config
man page )
matching
- push all branches having the same name in both ends.
但是:
This is currently the default, but Git 2.0 will change the default to
simple
.
upstream
- push the current branch to its upstream branch.
With this, git push will update the same remote ref as the one which is merged by git pull, making push and pull symmetrical.
(因为feature
最初在GitHub中没有upstream分支,所以不会推送)
(政策的变化是in discussion for the past few months)
所以现在,如果你确实将你的 feature
分支推送到 GitHub,在将它本地 merge 到 develop
并推送 develop
之前,你需要从 GitHub 中删除您的功能分支:
git push origin :feature
git flow 的唯一原因如果您在此过程中的任何时候都没有指定标志“fetch
”,则不会删除功能分支。 See sources .
# delete branch
if flag fetch; then
git push "$ORIGIN" ":refs/heads/$BRANCH"
fi
这意味着你应该做一个
git flow feature finish -F new_feature
我们的想法是先获取并确保在删除之前,其他 贡献者没有向 GitHub 上的 new_feature
添加新的演变。
关于Git 流 : Do you have to manually delete the feature branches from remote after finishing the feature?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11150810/
我是一名优秀的程序员,十分优秀!