> For the complete documentation index, see [llms.txt](https://railsgirlskc.gitbook.io/workshop-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://railsgirlskc.gitbook.io/workshop-guide/part-2-push-your-app-to-github.md).

# Part 2: Push Your App to Github

## Things you need before you get started  <a href="#things-you-need-before-you-get-started" id="things-you-need-before-you-get-started"></a>

### Git & GitHub  <a href="#git--github" id="git--github"></a>

* Check if Git is installed
  * In the terminal type `git --version` (1.8 or higher preferred)
* If not, download Git [here](http://git-scm.com/downloads). Then, setup your local Git profile - In the terminal:
  * Type `git config --global user.name "your-name"`
  * Type `git config --global user.email "your-email"`
  * *To check if Git is already config-ed you can type* `git config --list`
* Create a free [GitHub](https://github.com/) account or login if you already have one

**COACH:** Talk a little about git, version control, and open source

## Push your app to GitHub using the command line  <a href="#push-your-app-to-github-using-the-command-line" id="push-your-app-to-github-using-the-command-line"></a>

On your GitHub profile click “new repo” <img src="/files/-LrWjW6g_BfbYJtd5Iam" alt="" data-size="line"> give it a name (example: rails-girls), brief description, choose the “public” repo option, and click “create repository”.

In the command line–make sure you `cd` into your railgirls folder–and type:

```
git init
```

This initializes a git repository in your project

Next check if a file called `README.rdoc` exists in your railsgirls directory:

```
ls README.rdoc
```

If the file doesn’t exist, create it by typing:

```
touch README.rdoc
```

**COACH:** Talk a little about README.rdoc

Then type:

```
git status
```

This will list out all the files in your working directory.

**COACH:** Talk about some of your favorite git commands

Then type:

```
git add .
```

This adds in all of your files & changes so far to a staging area.

Then type:

```
git commit -m "first commit"
```

This commits all of your files, adding the message “first commit”

Next type:

```
git remote add origin https://github.com/username/rails-girls.git
```

*Your GitHub Repository page will list the repository URL, so feel free to copy and paste from there, rather than typing it in manually. You can copy and paste the link from your GitHub repository page by clicking the clipboard icon next to the URL.*

This creates a remote, or *connection*, named “origin” pointing at the GitHub repository you just created.

Then type:

```
git push -u origin master
```

If this command results in an error like `fatal: unable to access error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version`then we'll install [git directly from the source](https://git-scm.com/download/win). Follow the default settings. Once the installation finishes, you will have a new program called "Git Bash" on your machine. You will use this command terminal for interacting with git throughout the tutorial.

This sends your commits in your “master” branch to GitHub

Congratulations your app is on GitHub! Go check it out by going to the same url you used above: <https://github.com/username/rails-girls> (without the .git part)

If you want to continue making changes and pushing them to GitHub you’ll just need to use the following three commands:

```
git add .
git commit -m "type your commit message here"
git push origin master
```

**COACH:** Talk about what makes a good commit message (active, descriptive and short).

## What’s next?  <a href="#whats-next" id="whats-next"></a>

### Be a Part of the Open Source Community  <a href="#be-a-part-of-the-open-source-community" id="be-a-part-of-the-open-source-community"></a>

* Follow your fellow Rails Girls & coaches on GitHub
* Star or watch their projects
* [Fork](https://help.github.com/articles/fork-a-repo) a repo, then clone and push changes to your fork. Share the changes with the originator by sending them a [pull request](https://help.github.com/articles/using-pull-requests)!
* Create an issue on a project when you find a bug
* Explore other open source projects - search by programming language or key word

### Learn more Git  <a href="#learn-more-git" id="learn-more-git"></a>

* Check out [trygit.org](http://try.github.io/)
* Use a [Git Cheatsheet](https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf)
* Look up Git Commands at [git-scm.org](http://git-scm.com/)
