Skip to content

Instantly share code, notes, and snippets.

@chrisfosterelli
Created October 24, 2014 01:23
Show Gist options
  • Save chrisfosterelli/f4dcf34ef94a6c1e412b to your computer and use it in GitHub Desktop.
Save chrisfosterelli/f4dcf34ef94a6c1e412b to your computer and use it in GitHub Desktop.
WORKSHOP 1
==========
Welcome!
Step 1: Download Git
: http://git-scm.com/downloads
Step 2: Setup Git
: git config --global user.name "Firstname Lastname"
: git config --global user.email "your_email@youremail.com"
Step 2: Checkout my repository
: git checkout https://github.com/chrisfosterelli/gittalkdemo1.git
Step 3: Create a new branch
: git branch YOUR_BRANCH_NAME
Step 4: Go to it
: git checkout YOUR_BRANCH_NAME
Step 4: Change something
Step 5: Stage and commit your changes
: git add .
: git commit
Step 6: Go back to the main branch
: git checkout master
Step 7: Merge in your new branch
: git merge YOUR_BRANCH_NAME
Step 8: Tada! Call me over and I'll show you the git log :)
Bonus points:
You'll have to figure the commands for this one out on your own
with Google. Git is a version control system, so you have the ability
to look at older versions of files. In the very first commit to
the repository you're reading, there was a file called "password.txt".
It was deleted later on, so it's no longer in the "current" version.
What is the password in that file? Let me know if you get it!
Double bonus points:
With Git, you can rewrite the history. This is almost always a VERY bad
idea to do, because it causes all sorts of problems everywhere.
Let's do it though! Rewrite the Git history of this repository and
show me that you changed the commit messages.
@chadfawcett
Copy link

Step 2

Should be git clone https://gith...
Also I would recommend instructing to cd gittalkdemo1 before creating the new branch.

Extra Thoughts

I would also recommend teaching git status and git add <filename> or git add -p rather than adding all changes at once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment