# Working Local

Who is using what OS?

* Install PuTTY on Windows&#x20;
* 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:

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

make the myapp directory

```bash
]$ mkdir myapp
```

cd into myapp

```bash
]$ cd myapp
```

initialize the git repo

```bash
]$ git init .
```

Make a text file

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

Add to git

```bash
]$ git add readme.md
```

Commit to git

```bash
]$ git commit -m "Initial commit"
```

Review git log

```bash
]$ git log
```

Make a change to your text file

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

Save changes and commit

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

Take a look at our log

```bash
]$ git log
```

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

```bash
]$ git reset --hard HEAD^
```

Let's add more text

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

Add and commit

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

**Rolling back the hands of time:**&#x20;

* 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")
