From 4733cae8db9634a9c80bcf76355484c4f65ba75b Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 21 Jul 2014 16:20:21 -0400 Subject: [PATCH 1/4] Move tutorial to recources directory. Initial crack at a challenge. --- git/README.md | 84 +++------------------------------------ git/resources/tag_me.md | 2 + git/resources/tutorial.md | 83 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 79 deletions(-) create mode 100644 git/resources/tag_me.md create mode 100644 git/resources/tutorial.md diff --git a/git/README.md b/git/README.md index 225ae01..125c8c9 100644 --- a/git/README.md +++ b/git/README.md @@ -1,83 +1,9 @@ -

Github Collaboration

+

Git Challenge

-

1. Getting an Existing Project on Github

+

Clone a Repo

-* Create a github account +

Make Changes and Commit Them Locally

-* Install git on your computer. `sudo install git` Or refer to http://githowto.com +

Push to Github and Make Pull Request

-* Configure git on your computer. Make sure these correspond with your github account settings. -``` -git config --global user.name "Your Name" -git config --global user.email "your_email@whatever.com" -``` - -* cd to your project's root directory - -* Initialize a git project in this directory `git init` - -* Add all files in your project to your local git repository `git add .` - -* Commit your project’s current state to git version control `git commit –m “commit notes”` - -* Go to your github account and create a repo for your project to reside - -* When you create the repo, you will be redirected to notes for connecting your local machine’s repo to your github repo: -``` -git remote add origin git@github.com:github-handle/repo-name.git -``` - -* Push your commits to the remote repository -```git push -u origin master``` - -

2. Basic Version Control of Your Repo

- -Resource: http://byte.kde.org/~zrusin/git/git-cheat-sheet-medium.png
-Resource: http://githowto.com/ - -* After the first `git push –u origin master` you will only need to use `git push` to push your new commits to your github repo. - -* After each new project change, make sure to add new files to your project with `git add .` or `git add filename`. Then commit changes with `git commit –m “commit notes”` - -* You can push whenever you want. If you have made several commits without pushing, they will all go at once with your next push. - -* Use `git log` to see a history of your commit changes and `git status` to see the status of your present work. - -* Now try doing some more advanced things like reverting, pulling, making new branches, etc by working through some of the attached resources. - -

3. Forking Existing Repos. Submitting Pull Requests

- -Resource: https://help.github.com/articles/fork-a-repo - -* Go to original author’s repo on github and fork into a github repo on your account. - -* Clone your forked repo onto your local computer -``` -git clone git@github.com:your-git-handle/reponame.git -``` - -* If you get error: port 22 connection refused, it’s probably an issue with github not being able to find your ssh key. Here’s a solution: http://stackoverflow.com/questions/7953806/github-ssh-via-public-wifi-port-22-blocked - -* Create a new branch for your repo. This is where you will make your changes. We will work from a new branch, leaving the original master branch unchanged. This will later allow us to submit a pull request without getting merge conflicts with the original branch. The new branch we will create will start off identically to the master branch: -``` -git checkout origin -b -``` - -* We are now working on the branch. Edit, add, delete the project files as you see fit in this branch. - -* Commit changes - -* Create the new branch on github your repo -``` -git remote add upstream https://github.com/YourGitHandle/Reponame.git -``` - -* Push your commit - -* Go to your github repo. Go to your branch. Submit pull request - -* The original author may now authorize the pull request. Once authorized, the author can now merge the new branch into the master branch with: -``` -git checkout -git merge master -``` +

**BONUS POINTS**

diff --git a/git/resources/tag_me.md b/git/resources/tag_me.md new file mode 100644 index 0000000..238a72a --- /dev/null +++ b/git/resources/tag_me.md @@ -0,0 +1,2 @@ +

Ruby Users Group - Git Masters:

+

Tag this wall with your name or handle to prove you completed the git challenge!

\ No newline at end of file diff --git a/git/resources/tutorial.md b/git/resources/tutorial.md new file mode 100644 index 0000000..225ae01 --- /dev/null +++ b/git/resources/tutorial.md @@ -0,0 +1,83 @@ +

Github Collaboration

+ +

1. Getting an Existing Project on Github

+ +* Create a github account + +* Install git on your computer. `sudo install git` Or refer to http://githowto.com + +* Configure git on your computer. Make sure these correspond with your github account settings. +``` +git config --global user.name "Your Name" +git config --global user.email "your_email@whatever.com" +``` + +* cd to your project's root directory + +* Initialize a git project in this directory `git init` + +* Add all files in your project to your local git repository `git add .` + +* Commit your project’s current state to git version control `git commit –m “commit notes”` + +* Go to your github account and create a repo for your project to reside + +* When you create the repo, you will be redirected to notes for connecting your local machine’s repo to your github repo: +``` +git remote add origin git@github.com:github-handle/repo-name.git +``` + +* Push your commits to the remote repository +```git push -u origin master``` + +

2. Basic Version Control of Your Repo

+ +Resource: http://byte.kde.org/~zrusin/git/git-cheat-sheet-medium.png
+Resource: http://githowto.com/ + +* After the first `git push –u origin master` you will only need to use `git push` to push your new commits to your github repo. + +* After each new project change, make sure to add new files to your project with `git add .` or `git add filename`. Then commit changes with `git commit –m “commit notes”` + +* You can push whenever you want. If you have made several commits without pushing, they will all go at once with your next push. + +* Use `git log` to see a history of your commit changes and `git status` to see the status of your present work. + +* Now try doing some more advanced things like reverting, pulling, making new branches, etc by working through some of the attached resources. + +

3. Forking Existing Repos. Submitting Pull Requests

+ +Resource: https://help.github.com/articles/fork-a-repo + +* Go to original author’s repo on github and fork into a github repo on your account. + +* Clone your forked repo onto your local computer +``` +git clone git@github.com:your-git-handle/reponame.git +``` + +* If you get error: port 22 connection refused, it’s probably an issue with github not being able to find your ssh key. Here’s a solution: http://stackoverflow.com/questions/7953806/github-ssh-via-public-wifi-port-22-blocked + +* Create a new branch for your repo. This is where you will make your changes. We will work from a new branch, leaving the original master branch unchanged. This will later allow us to submit a pull request without getting merge conflicts with the original branch. The new branch we will create will start off identically to the master branch: +``` +git checkout origin -b +``` + +* We are now working on the branch. Edit, add, delete the project files as you see fit in this branch. + +* Commit changes + +* Create the new branch on github your repo +``` +git remote add upstream https://github.com/YourGitHandle/Reponame.git +``` + +* Push your commit + +* Go to your github repo. Go to your branch. Submit pull request + +* The original author may now authorize the pull request. Once authorized, the author can now merge the new branch into the master branch with: +``` +git checkout +git merge master +``` From 53f0e6d2b76953f70d5c1b84937aa1dd1d75e9ec Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 21 Jul 2014 16:32:21 -0400 Subject: [PATCH 2/4] add some content --- git/README.md | 6 ++++++ git/resources/tag_me.md | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/git/README.md b/git/README.md index 125c8c9..4d6b4e9 100644 --- a/git/README.md +++ b/git/README.md @@ -1,9 +1,15 @@

Git Challenge

Clone a Repo

+Clone the Get Your Hands Dirty With Ruby challenges repo using `git clone`. You might want to keep it on your local machine even after the challenge. Contributing to this repo is highly encouraged!

Make Changes and Commit Them Locally

+* Open the cloned repo in your favorite text editor. +* Create a new branch to work from. Add your name to the list of Git champions. +* Commit your changes to your local machine.

Push to Github and Make Pull Request

+Now that you've committed your changes in a separate branch, you can push them up to your own git repo. Go to Github and put in a pull request so your project will be merged into the original one. Once it's merged, don't forget to `git pull` the newly updated version onto your computer and `git push` it back up to your own repo. Your now the proud collaborator of an open source Ruby Users Group project!

**BONUS POINTS**

+You've got the basics of collaborating on Github, so why not contribute to this repo? Either add a new challenge course, or start with something simpler, like adding external resources. \ No newline at end of file diff --git a/git/resources/tag_me.md b/git/resources/tag_me.md index 238a72a..5734a2f 100644 --- a/git/resources/tag_me.md +++ b/git/resources/tag_me.md @@ -1,2 +1,3 @@

Ruby Users Group - Git Masters:

-

Tag this wall with your name or handle to prove you completed the git challenge!

\ No newline at end of file +Tag this wall with your name or handle to prove you completed the git challenge! +
\ No newline at end of file From 605ba538c55d0c3bdbf9bac5e96d1059ad406bbf Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 21 Jul 2014 16:37:03 -0400 Subject: [PATCH 3/4] Updated typo. Added link --- git/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git/README.md b/git/README.md index 4d6b4e9..fcd5cbc 100644 --- a/git/README.md +++ b/git/README.md @@ -1,7 +1,7 @@

Git Challenge

Clone a Repo

-Clone the Get Your Hands Dirty With Ruby challenges repo using `git clone`. You might want to keep it on your local machine even after the challenge. Contributing to this repo is highly encouraged! +Clone the Wes Michigan Ruby Users challenges repo using `git clone`. You might want to keep it on your local machine even after the challenge. Contributing to this repo is highly encouraged!

Make Changes and Commit Them Locally

* Open the cloned repo in your favorite text editor. From da13d220df359ca0ede35faaef4d2be97d2cbb39 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 21 Jul 2014 16:40:00 -0400 Subject: [PATCH 4/4] Fixed formatting --- git/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git/README.md b/git/README.md index fcd5cbc..19574ab 100644 --- a/git/README.md +++ b/git/README.md @@ -5,7 +5,8 @@ Clone the Wes Michigan Ruby Users