1

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.

Community
  • 1
  • 1
EHorodyski
  • 684
  • 1
  • 7
  • 24
  • 2
    Please be careful with your git terms, because it appears you're not using them correctly, and thus it's a little unclear what you're trying to do. You don't "branch repos", you "clone" repos. Branches are just lines of development within a repo. And `master` is the standard name for the default branch in newly cloned repos, but there's nothing particularly special about it, it's just like any other branch. –  Mar 14 '14 at 04:31
  • 1
    Also, please add the exact commands that you used but didn't appear to work for you. Did you do `git clone `? The newly cloned repo will contain all branches from the source repo, but will have the `master` branch checked out by default. If you want to check out a different branch, you just do `git checkout -b origin/`. –  Mar 14 '14 at 04:34

1 Answers1

1

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.

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • Thanks, I'll give this a try later tonight when I get home. The post I referenced missed the last `master` command. Also, thanks for the link to elaborate on this. – EHorodyski Mar 14 '14 at 13:56
  • *Edit*: I might be dumb. Are branches done on the repo level and all this time I thought a branch contained all repos? However, I am still looking to just fork the current repo in the branch so that it could have a seperate repo name. The command you posted above gave me a fatal error saying the repository couldn't be found. I think I need to read up on GitHub on my own and just work locally for now. – EHorodyski Mar 15 '14 at 04:28
  • @EHorodyski What is the *exact* error message you see? Branches are done for the all repo. See http://git-scm.com/book/en/Git-Branching-What-a-Branch-Is – VonC Mar 15 '14 at 06:31