如何提交&推送选中的文件,但不是全部在Git中 [英] How to commit & push selected files but not all in Git
问题描述
我有一个有两个分支的git仓库: develop
和 master
。我主要在 develop
上工作,当文件准备就绪时(有时候对这个确认不太粘),我将它们合并到 master
分公司将其投入生产。看看这张图:
所有文件来自 develop
分支并被合并,但我只想提交并推送 RepresentativeRestController.php
但任何时候我做右键单击=>提交它们都包含在提交中。我是如何摆脱的,因为他们会在稍后添加,而我不希望被包含在提交中?我使用Smartgit作为Bitbucket存储库的GUI客户端。任何建议?
我不确定如何使用您正在使用的Git UI执行此操作,但是应该是一个屏幕或者一些东西来管理哪些文件被修改,哪些不是。
I have a git repo with two branches: develop
and master
. I work mostly at develop
and when files are ready (sometimes not so sticky to this affirmation) I merge them to master
branch to put them on production. Take a look to this pic:
All that files comes from develop
branch and was merged but I only want to commit and push RepresentativeRestController.php
but any time I do right click => commit all of them are included on the commit. How I get rid, temporary since they will be added later, of the ones I don't want to be included on the commit? I use Smartgit as a GUI client for Bitbucket repository. Any advice?
When you make a commit, all the staged file are included in the commit. If you wish to exclude certain files from a commit, unstage those files first.
I'm not sure how to do that with the Git UI you are using, but there should be a screen or something to manage which files with changes are staged and which aren't.
这篇关于如何提交&推送选中的文件,但不是全部在Git中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!