Working Local

Who is using what OS?

  • Install PuTTY on Windows

  • Find 'Terminal' on OS X

Shell into wmsandbox

  • account details given at the training

After shelling in, set up git to know who you are:

git config --global user.name "[Your-name-here]"
git config --global user.email "[Your-email-here]"

make the myapp directory

]$ mkdir myapp

cd into myapp

]$ cd myapp

initialize the git repo

]$ git init .

Make a text file

]$ echo "This is my training repo" > readme.md

Add to git

]$ git add readme.md

Commit to git

]$ git commit -m "Initial commit"

Review git log

]$ git log

Make a change to your text file

]$ echo "Just another line of text" >> readme.md

Save changes and commit

]$ git commit -am "Added a line of text to my readme file"

Take a look at our log

]$ git log

Oops...I don't want that...and I don't want the history

]$ git reset --hard HEAD^

Let's add more text

]$ echo "Hello world" >> readme.md

Add and commit

]$ git commit -am "this change I want to keep"

Rolling back the hands of time:

  • git revert : creates new commit history record and changes code back (this typically is preferred)

  • git checkout: pulls content from specific commit, does not touch history

  • git reset: changes code and potentially erases history ("undo button")

Last updated