2

I recently forked an open source git(origin) and now the requirement is such that the changes need to be kept private. While these changes could be pushed to public fork in near future, for now I need to keep them private.

The route I've taken to archive this is by creating a new private repository and adding this as a remote(private).

I want to manage all the new changes in private remote for now. And I'm using hubflow.

Now, when I run:

git hf feature start <feature-name>

My new branch is created from origin.

So I went ahead and deleted origin branch and let the branch exist only on private remote.

Made some changes, created a commit and did:

git hf push

The changes were pushed at private, but also the branch was created on origin and all the changes were pushed.

I want the changes to stay within the private repository only.

Thanks in advance. Cheers!!

Anupam Juniwal
  • 309
  • 1
  • 3
  • 11

1 Answers1

0

You might consider changing the URL of origin to reference your private repository, and adding a new remote named upstream to reference the original repository

git remote set-url origin https://github.com/your/private-repository
git remote add upstream https://github.com/the/original-repository

That way, any push to origin would be in your own private repository anyway.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • This is a great approach, I probably would end-up doing this. However I'm more curious if there is a solution to configure Hubflow to archive the same. – Anupam Juniwal Oct 13 '22 at 07:05
  • @AnupamJuniwal Since Hubflow is using Git, I suspect it will have an influence. – VonC Oct 13 '22 at 08:02