|
| 1 | +goals do |
| 2 | + goal "Create a new git repository locally" |
| 3 | + goal "Create a new git repository on GitHub" |
| 4 | + goal "Push your local repository to GitHub" |
| 5 | +end |
| 6 | + |
| 7 | +steps do |
| 8 | + tip "If you have a 'railsbridge' folder on your computer or some other place you like to keep project files, `cd` to that directory and then follow the steps below." |
| 9 | + |
| 10 | + step "Make a special new directory" do |
| 11 | + message "To get started on the project, you'll need to open up your command line. If you have a Mac, open up the Terminal app. If you're on a PC, look for a program called Command Prompt. You'll also need to know your GitHub user name and password. Wherever you see `[your-github-user-name]`, you'll replace that with your user name (and delete the braces: the `[` and `]`)." |
| 12 | + console "mkdir [your-github-user-name].github.io" |
| 13 | + message "`mkdir` stands for 'make directory.' You just made a new directory that you'll put your project files in." |
| 14 | + end |
| 15 | + |
| 16 | + step "Initialize a new local git repository" do |
| 17 | + console "cd [your-github-user-name].github.io" |
| 18 | + message "You just changed directories and moved into the folder you just created." |
| 19 | + console "git init" |
| 20 | + message "You just initialized an empty repository, i.e. told git, 'I want to start a new project here.'" |
| 21 | + end |
| 22 | + |
| 23 | + step "Make a commit" do |
| 24 | + console "touch index.html\ngit add index.html" |
| 25 | + message "This creates a blank, new file called 'index.html'. The next line tells git you want to stage the file." |
| 26 | + console "git commit -m 'first commit'" |
| 27 | + message "You just made an initial commit. (Think of it as a snapshot of your project that you can come back to later.)" |
| 28 | + end |
| 29 | + |
| 30 | + step "Add GitHub as a remote" do |
| 31 | + message "You really do have to type your user name three times in the next command. Get ready for it." |
| 32 | + console "git remote add origin https://[your-github-user-name]@github.com/[your-github-user-name]/[your-github-user-name].github.io.git" |
| 33 | + |
| 34 | + message "You just set up a 'remote' — a git repository somewhere else (in this case, on GitHub) that also holds your project files." |
| 35 | + end |
| 36 | + |
| 37 | + step "Create a new repo via the GitHub UI" do |
| 38 | + tip "You can skip this step if you've created a ***[your-github-user-name].github.io*** page previously." |
| 39 | + message "Navigate to https://github.com/[your-github-user-name]/" |
| 40 | + message "Click 'Create a new repo' in the upper right" |
| 41 | + img :src => "img/github_create_repo.png" |
| 42 | + message "Type **[your-github-user-name].github.io** into the 'Repository name' box" |
| 43 | + img :src => "img/github_name_your_repo.png" |
| 44 | + |
| 45 | + important "Do not choose 'Initialize this repository with a README' when creating the repo." |
| 46 | + end |
| 47 | + |
| 48 | + step "Push your code to GitHub" do |
| 49 | + message "Now, push the new file you just committed to GitHub." |
| 50 | + console 'git push -u origin master' |
| 51 | + message "You'll probably be prompted to type your GitHub password at this point. After you do, you'll have just pushed your project to GitHub's servers!" |
| 52 | + important "If you have existing content in your GitHub Pages repo, this command will fail, and you will have to do a `git push -uf origin master` instead. Verify with a volunteer first that you're doing the right thing." |
| 53 | + end |
| 54 | + |
| 55 | + step do |
| 56 | + message "Woohoo!!! Take a breath and wait a few minutes." |
| 57 | + message "Since you gave your GitHub repository a special name (in the format [your-github-user-name].github.io), GitHub will automatically take the contents of this one repository and make them your personal web page on GitHub. However, there's a small lag between the first push and being able to see your content on the web." |
| 58 | + message "In a few minutes time, when you visit [your-github-user-name].github.io in a browser, you should see a blank white page: this is great! You're looking at the index.html file you just created, now live on the web!" |
| 59 | + end |
| 60 | +end |
0 commit comments