如何在作曲家库中保存对将来的私人项目的修改? [英] How to preserve modifications in a composer library for future private projects?

查看:80
本文介绍了如何在作曲家库中保存对将来的私人项目的修改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Composer库进行了许多修改和修复,该库从github获取数据,并且确实具有依赖性.

I have made many modifications and fixes to a composer library that gets it's data from github , and it does have a dependency.

如何在能够从程序包所有者那里获取更新的同时轻松地保存它们?

How can I preserve them easily while being able to get updates from package owner?

推荐答案

您可以在Github上分叉项目,对分叉进行修改,然后将作曲家指向该项目.

You could fork the project on Github, commit your modifications to your fork, then point composer at it.

当新的更新来自原始包所有者时,您可以使用git的标准合并功能将其合并到您的项目中.

When new updates come from the original package owner, you can merge them into your project using git's standard merge features.

当我在github上创建了一个项目时,通常会在本地副本上保留两个远程对象,就像这样:

When I have a project I have forked on github, I will often keep two remotes on my local copy, like so:

git clone [url of my fork]
cd [project name]
git remote add upstream [url of original project]

将更新应用于原始项目时,我会执行以下操作:

When updates are applied to the original project, I do something like:

git fetch upstream
git merge upstream/master

这篇关于如何在作曲家库中保存对将来的私人项目的修改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆