stevejenkins / pihole-cloudsync

Syncs blocklists, blacklists, and whitelists across multiple Pi-holes using a private GitHub repo
MIT License
515 stars 105 forks source link

Documentation - Marking Forked Repository Private #13

Closed JeffHochberg closed 3 years ago

JeffHochberg commented 4 years ago

In the step-by-step directions, under "On GitHub" step 3 calls for creating a fork, then step 4 (optional) is on marking the forked repo as private.

I just tried this and, in the Danger Zone section, there's a message that states "Public forks can't be made private. Please duplicate the repository."

I've never tried forking a repository before, so this is all new to me. I am going to try the process that GitHub outlines in terms of duplicating a repo but I thought I would bring this to your attention in the event you wanted to add details to your documentation.

Thanks so much for sharing this!!!

aram535 commented 3 years ago

Steps to make a private repo and clone the repo and still link:

1. Create a private repo in your namespace called pihole-cloudsync
2. git clone --bare https://github.com/stevejenkins/pihole-cloudsync.git
3. cd pihole-cloudsync
4. git push --mirror https://github.com/<username>/pihole-cloudsync.git 
5. cd ..
6. rm -rf pihole-cloudsync.git 
7. git clone https://github.com/<username>/pihole-cloudsync.git 
8. cd pihole-cloudsync
9. git remote add fork https://github.com/stevejenkins/pihole-cloudsync.git
10. git stash ## optional step in case you have any local changes
11. git merge fork master  ## to update from steve's repository
12. git stash pop ## optional step to add any changes back in 
dispo2 commented 3 years ago

I'm new to git and trying to get my head around how this works but isnt the requirement to make the 'my-pihole-lists' repo private ? That is the repo that contains custom info for each pihole setup.

The above instructions are for the pihole-cloudsync repo which is where the code resides.

JeffHochberg commented 3 years ago

I should have based my original post on https://github.com/stevejenkins/my-pihole-lists (not pihole-cloudsync).

I just went through the process of forking my-pihole-lists to my-pihole-lists-forked, then mirrored from my-pihole-lists-forked to my-pihole-lists. I created a new repository called my-pihole-lists and marked it as "private", then followed the official GitHub documentation on duplicating a repository.

https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/duplicating-a-repository

Additionally - I used SSH key based authentication which required that I go through the initial git configuration process, adding the SSH key to my GitHub profile, as well as adding the SSH key to the keychain on the server running pihole.

The following resources were helpful:

Generating a new SSH key and adding it to the ssh-agent https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

Adding a new SSH key to your GitHub account https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account

Testing Your SSH Connection https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/testing-your-ssh-connection

JeffHochberg commented 3 years ago

Marking issue as resolved - provided links to documentation that helped with the process