R
R
Ruslan2021-05-31 09:29:48
git
Ruslan, 2021-05-31 09:29:48

How to modify an updated clone of someone else's project?

Hello. please tell me how to solve this problem.
There is an open repository of some project in github, which is regularly updated by its authors.
I want to clone this repository for myself and overwrite one source file.
The repository is regularly updated and I need to be able to update my clone and at the same time that the file I modified remains mine, i.e. not overwritten from the original (cloned) repository.
How to organize this? what git commands?

Thanks for the tip.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2021-05-31
@Razbezhkin

Clone the original repository. In the clone, start your own branch, make your changes to it.
When the authors update their repo, update the master of the clone from the original repository, then rebase your branch to the new master with conflict resolution.

G
GavriKos, 2021-05-31
@GavriKos

You can't do that. And if the file changes so that it can no longer work with other files? Roughly speaking, methods / apishka change and all that - and now your file is completely incompatible with the rest of the project.
The usual merge is enough, but you will have to control the conflicts with your hands. Well, make changes minimally modifying the source file itself (depending on the language, architecture and a bunch of other things)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question