简体   繁体   中英

Forking my own repo

I'm developing a CSS Style Guide that I would like to publish for people to fork on GitHub.

I know that others can easily Fork my repo, but is there a way I can fork my own for use of my own personal site (without ruining the blank slate project)? I used this old entry to attempt this myself, but all I managed to do was register the names with GitHub and no pushes happened nor forks created.

As a TFS user, the structure is a bit strange to me. Normally in TFS you have a collection of projects that you branch, to create a structure like so:

TFSProjects
    Project 1
        Dev Branch
        Staging Branch
        Release Branch

I'm trying to use this approach for my repo so I can get this:

master
    styleguide
        personal styleguide
        company1 styleguide

This is where I get completely confused. In TFS, I can just simply branch anything that is a .sln . I totally understand I won't be able to do this here, but when I connect to GitHub through Visual Studio first I see that I'm in the master branch, and then the solution inside so, which is styleguide . I don't see an option to branch styleguide , only to create a new branch, which I'm led to believe is a new top level item (a collection of new repos).

Looking online, I followed this code from the link above but nothing got pushed to GitHub online:

$ git clone https://github.com/your_name/old_project new_project
# make new, empty project on GitHub called new_project
$ cd new_project
$ git remote rename origin old_project
$ git remote add origin https://github.com/your_name/new_project
$ git push -u origin

I know I should probably read one of those free eBooks on Git, but I figured I'd ask here first to see if I could get an answer quicker than I would be able to get the time around the house to read a book :P

Thanks again for all help.

I don't see an option to branch styleguide, only to create a new branch, which I'm led to believe is a new top level item (a collection of new repos).

Branch is a first-class citizen in Git (like TFS since TFS 2010)

When you make a new branch, you make it for the all repo. You don't add a "ne top level", meaning the folders and files within your repo remains as they were.
But you will isolate the changes done on those elements (folders and files) in the branch you just created.

Your last git push could work, provided you provide all the parameters for the first push:

git push -u origin master
<Enter your GitHub login and password there>

See " Why do I need to explicitly push a new branch? " for more.

Note that the GitHub login/password won't work if you have activiate the 2FA on GitHub: see " Configure Git clients, like GitHub for Windows, to not ask for authentication ": you would need to generate a PAT (Personal Access token) to use as your password.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM