简体   繁体   English

Github分叉仓库

[英]Github Forked Repo Configuration

I have a fork of a corporate Github repo with a web application that I am working on. 我有一个公司Github存储库的分支,其中包含我正在处理的Web应用程序。 Creating the fork and cloning it are not the problem. 创建派生并克隆它不是问题。

I have to make initial changes to the master branch in order for the website to run locally on my machine... the web.config file and the publish profile. 为了使网站在我的机器上本地运行,我必须对master分支进行初始更改... web.config文件和发布配置文件。 All other work and changes will be done with branches that I will submit pull requests for. 所有其他工作和更改将通过我要提交拉取请求的分支完成。

The question that I have is how do I prevent the changes to the new web.config file and creation of the local publish profile from being included in any commit? 我的问题是如何防止对新的web.config文件的更改以及本地发布配置文件的创建不包含在任何提交中?
I tried ignoring the files, but now git wants to include the change to the gitignore file which I do not want either and even after ignoring the web.config file, git is still tracking changes. 我尝试忽略文件,但现在git希望将更改包括在内,我也不希望这样做,即使忽略了web.config文件,git仍在跟踪更改。

Everytime I submit a pull request, it contains these commits that I do not want included in the pull request. 每次我提交拉取请求时,它都会包含我不希望包含在拉取请求中的这些提交。

Please keep in mind that I am not a "command-line" person and I am a novice at best with github and gitbash. 请记住, 我不是“命令行”用户,并且我是github和gitbash的新手。 I have been using SourceTree and GitKraken, but I am still having a difficult time. 我一直在使用SourceTree和GitKraken,但我仍然遇到困难。

First, don't forget to make your changes in a branch (not on master directly), in order to push that branch and make your pull request from there. 首先,不要忘了在分支中进行更改(而不是直接在master上),以便推送该分支并从那里发出拉取请求。

But for files you don't want to see considered for index and commit, you would need (in command line, but it is easy) to type: 但是对于不想被视为索引和提交的文件,则需要(在命令行中,但很容易)键入:

git update-index --assume-unchanged --  web.config

Then any modification to that file would be ignored by Git. 然后,对该文件的任何修改将被Git忽略。

For files generated (which should not tracked at all), you can add them in your .gitignore , and it is not a bad idea to include said .gitignore in your PR. 对于生成的文件(根本不应该跟踪),您可以将它们添加到.gitignore ,在您的PR中包含所说的.gitignore并不是一个坏主意。

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

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