WFU-TLC / flc_discussion_board

A repository for discussing questions and issues in the Data Analysis with R (FLC)
https://wfu-tlc.github.io/
0 stars 0 forks source link

GH Navigation Issue Two #2

Closed adanieljohnson closed 5 years ago

adanieljohnson commented 5 years ago

Also probably obvious. If I want to copy someone else's repo, I can fork it. But if I have a repo that I own (template I want to use for other repos, for example), I cannot fork a repo that I own myself. Do I have to clone it and create it locally via URL? Seems the long way around.

francojc commented 5 years ago

Forking is just to create a copy of a repo on your profile. Repositories that you create on your profile or that you fork to your profile are then cloned to your local machine. From then on your local copy will point to the relevant GitHub repo for updates that you push.

Let me know if helps clarify things.

adanieljohnson commented 5 years ago

So how do I fork my OWN repos within GitHub? Example: I have forked copies of Mike's standard template for project files and folders, and of our standard template for web sites. I need to duplicate those for each new site or project. Easy on desktop, but I get an error if I try to fork them inside my own profile.

francojc commented 5 years ago

Once they are on your personal repo, you no longer will 'fork' them. Rather, you will clone them to your machine. Then if you want to make this clone a different project/repo on GitHub you will need to create a new repository on GitHub with the new name that reflects the project. Once you've got an empty repo you can then copy the 'clone' address and change the local repo's remote location.

From the Terminal, you will navigate to the cloned repo on your machine.

To see where the local repo is pointing on GitHub type:

> git remote -v

You should see something like this:

origin  https://github.com/WFU-TLC/analyzr.git (fetch)  
origin  https://github.com/WFU-TLC/analyzr.git (push)

Where the WFU-TLC/ will be your GitHub handle and the analyzer.git the name of the clone repo.

What you want to do now is change these URLs to point to the new repo you created on GitHub. Update the remote address with this command:

> git remote set-url origin https://github.com/USERNAME/REPOSITORY.git

You can verify that the change has been made by again running:

> git remote -v

You should see the change reflected. You can now make edits, stage them, commit, and then push the changes to this new repository from now on.

Here's a link to the official GitHub documentation outlining this same process.

adanieljohnson commented 5 years ago

What I needed. Thx.