githubvimpull-requestgit-forkvundle

Manage own fork of Vim plugins with Vundle


I use Vundle as plug-in manager in Vim and it happens that I want to make modifications to some plug-in to correct bugs or to implement personal changes.

What I do in general is

  1. fork the original repo
  2. edit the .vimrc file and change the line Plugin 'original-repo' to Plugin 'my-fork', run :so % and then :PluginInstall
  3. make changes and commit
  4. push to my fork
  5. send a PR

At this point the PR can be accepter or rejected. In the former case, everything's ok. What about the latter case?

What I mean is that in general I can decide to keep the unaccepted edit in my fork (I've just committed it, after all), as well as in the local branch (that is, I keep Plugin 'my-fork' in my .vimrc file), since I consider this edit to be important to me, for some reason. On the other hand, I don't want my fork to get old just because I diverged by one or a few commits; that is, I still want to have my fork include new commits of the original repo. In addition, I want to be still able to send PR of other commits I can do, paying attention to the PR best practice of sending PRs from a synced fork.

I can imagine what the tools are fit for purpose, i.e.

which I'm already using.

So the question is: what is the workflow I should follow to manage Vim plugins to which I can possibly participate with PRs of commits (and I obviously can't know in advance which PRs are accepted and which are rejected)?


Solution

  • GitHub as whole guide devoted to working with forks.

    In short:

    1. you define a new remote repository that points to the original,
    2. you fetch and merge from that "upstream" remote repository to keep your repository in sync.