Commit 51562501 authored by French, Robert's avatar French, Robert Committed by GitLab
Browse files

Separate everything cleanly into slides

parent cc1b5790
<!-- $theme: gaia -->
# Don't Panic
## Gitting Unlost
# Don't Panic: Gitting Unlost
### Tom Barron & Robert French
---
<!-- page_number: true -->
## Overview
**Thursday 2/23, 9:00am in JICS Auditorium (5100 RM 128)**
* Confused about the current state of your git universe?
* Feel like your head is detached?
* Don't Panic! We can show you how to "git unlost"!
Confused about the current state of your git universe? Feel like your head is
detached? Don't Panic! We can show you how to "git unlost"!
In this workshop, we'll show how to navigate your git repo, salvage your
current state, and some other tricks for getting back to a sane environment.
---
Offsite folks can join us via [BlueJeans](https://bluejeans.com/309751285).
## Overview
[next](slide1.md)
In this workshop, we'll show how to:
* navigate your git repo,
* salvage your current state, and
* some other tricks for getting back to a sane environment.
* add some stuff about fancy log formats for understanding my network of branches
* add more stuff
We've all done it. You deleted a file three commits ago and now you
need it back after all. So you go looking back through git log...
commit be1ddb4657efe46c2f60650026009288b9d94a8e
Merge: 604a052 9ab0b2b
Author: French, Robert D <frenchrd@ornl.gov>
Date: Tue Jan 3 10:35:26 2017 -0500
Merge branch 'gitting-unlost' into 'master'
Don't panic -- gitting unlost
(suggested by @tpb)
See merge request !4
commit 9ab0b2bbc81a7443bffba689596c1525b75e5fcd
Author: robertdfrench <frenchrd@ornl.gov>
Date: Tue Jan 3 10:34:50 2017 -0500
Don't panic -- gitting unlost (suggested by @tpb)
commit 604a05277816a8b6c599c2420e8cecf3302a5854
Author: French, Robert D <frenchrd@ornl.gov>
Date: Thu Dec 29 09:56:50 2016 -0500
Reminder to submit workshops to ORNL Today
commit 957bc7f8d4c96fe4a267282a59bf694545a7c897
Author: French, Robert D <frenchrd@ornl.gov>
Date: Thu Dec 29 09:32:49 2016 -0500
Move 12/29 to Recent Workshops
---
commit 40c78ed75bd3c5ce16f8f16d5186450d20b26c96
Author: French, Robert D <frenchrd@ornl.gov>
Date: Thu Dec 29 09:30:27 2016 -0500
## Where am I?
Reminder to set up BlueJeans for each meeting
We've all done it. You deleted a file three commits ago and now you need it back after all. So you go looking back through git log...
commit eca3bedcf0239321cb59bc6e4480642ac11a2e9f
Author: French, Robert D <frenchrd@ornl.gov>
Date: Wed Dec 28 15:01:59 2016 -0500
```py
be1ddb4 Merge branch 'gitting-unlost' into 'master'
9ab0b2b Don't panic -- gitting unlost (suggested by @tpb)
604a052 Reminder to submit workshops to ORNL Today
957bc7f Move 12/29 to Recent Workshops
40c78ed Reminder to set up BlueJeans for each meeting
eca3bed Add BlueJeans Link
```
Add BlueJeans Link
Oh, yeah! It's in `40c78ed`. Let's check that out:
...
---
### The infamous 'detached HEAD' state
Oh, yeah! It's in 40c78ed75bd3c5ce16f8f16d5186450d20b26c96
```bash
$ git checkout 40c78ed
$ git checkout 40c78ed75bd3c5ce16f8f16d5186450d20b26c96
Note: checking out '40c78ed75bd3c5ce16f8f16d5186450d20b26c96'.
You are in 'detached HEAD' state. You can look around, make experimental
......@@ -86,55 +59,27 @@ Oh, yeah! It's in 40c78ed75bd3c5ce16f8f16d5186450d20b26c96
git checkout -b <new-branch-name>
HEAD is now at 40c78ed... Reminder to set up BlueJeans for each meeting
```
Umm... Okay. So I've copied the file I want someplace safe. Now how do
I get back to where I was? Maybe 'git log' will let me get back to my
current tip?
---
But no, the output of 'git log' now starts with the commit I just
checked out. How do I find my subsequent commits? Are they still
there? Oh no!
### The infamous 'Detached HEAD' state
Umm... Okay. So I've copied the file I want someplace safe. Now how do I get back to where I was? Maybe 'git log' will let me get back to my current tip?
$ git log
commit 40c78ed75bd3c5ce16f8f16d5186450d20b26c96
Author: French, Robert D <frenchrd@ornl.gov>
Date: Thu Dec 29 09:30:27 2016 -0500
Reminder to set up BlueJeans for each meeting
commit eca3bedcf0239321cb59bc6e4480642ac11a2e9f
Author: French, Robert D <frenchrd@ornl.gov>
Date: Wed Dec 28 15:01:59 2016 -0500
Add BlueJeans Link
commit a7eb7fea1921aae01bacefb03d0a5eaedfb853fa
Author: French, Robert D <frenchrd@ornl.gov>
Date: Wed Dec 28 15:01:27 2016 -0500
Add BlueJeans Link
commit 526b5fd30e08a630b9ce8a14594e050dda4757b5
Author: French, Robert D <frenchrd@ornl.gov>
Date: Wed Dec 28 14:59:44 2016 -0500
Move cancelled 12/22 topic to 2/16
commit 27fac7af17eea381b3c03c2c894de50724768468
Merge: 7b49484 5c2f9e9
Author: French, Robert D <frenchrd@ornl.gov>
Date: Wed Dec 28 14:53:45 2016 -0500
Merge branch 'branches-for-fun-and-profit' into 'master'
Add slides for Branches talk
See merge request !3
[previous](README.md) | [next](slide2.md)
But no, the output of 'git log' now starts with the commit I just checked out. How do I find my subsequent commits? Are they still there? Oh no!
$ git log --pretty=oneline
40c78ed Reminder to set up BlueJeans for each meeting
eca3bed Add BlueJeans Link
a7eb7fe Add BlueJeans Link
526b5fd Move cancelled 12/22 topic to 2/16
27fac7a Merge branch 'branches-for-fun-and-profit' into 'master'
---
Don't panic. 'git branch -a' will clarify things:
### Don't panic. 'git branch -a' will clarify things:
$ git branch -a
......@@ -144,63 +89,70 @@ Don't panic. 'git branch -a' will clarify things:
remotes/origin/master
remotes/origin/tpb-rf9-dont-panic-gitting-unlost
I can get back to my master branch simply checking out master
* I can get back to my master branch simply checking out master
$ git checkout master
Previous HEAD position was 40c78ed... Reminder to set up BlueJeans for each meeting
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
---
And now 'git log' shows everything again
commit be1ddb4657efe46c2f60650026009288b9d94a8e
Merge: 604a052 9ab0b2b
Author: French, Robert D <frenchrd@ornl.gov>
Date: Tue Jan 3 10:35:26 2017 -0500
Merge branch 'gitting-unlost' into 'master'
Don't panic -- gitting unlost
(suggested by @tpb)
See merge request !4
commit 9ab0b2bbc81a7443bffba689596c1525b75e5fcd
Author: robertdfrench <frenchrd@ornl.gov>
Date: Tue Jan 3 10:34:50 2017 -0500
Don't panic -- gitting unlost (suggested by @tpb)
commit 604a05277816a8b6c599c2420e8cecf3302a5854
Author: French, Robert D <frenchrd@ornl.gov>
Date: Thu Dec 29 09:56:50 2016 -0500
Reminder to submit workshops to ORNL Today
commit 957bc7f8d4c96fe4a267282a59bf694545a7c897
Author: French, Robert D <frenchrd@ornl.gov>
Date: Thu Dec 29 09:32:49 2016 -0500
Move 12/29 to Recent Workshops
commit 40c78ed75bd3c5ce16f8f16d5186450d20b26c96
Author: French, Robert D <frenchrd@ornl.gov>
Date: Thu Dec 29 09:30:27 2016 -0500
Reminder to set up BlueJeans for each meeting
commit eca3bedcf0239321cb59bc6e4480642ac11a2e9f
Author: French, Robert D <frenchrd@ornl.gov>
Date: Wed Dec 28 15:01:59 2016 -0500
$ git log --pretty=oneline
Add BlueJeans Link
be1ddb4 Merge branch 'gitting-unlost' into 'master'
9ab0b2b Don't panic -- gitting unlost (suggested by @tpb)
604a052 Reminder to submit workshops to ORNL Today
957bc7f Move 12/29 to Recent Workshops
40c78ed Reminder to set up BlueJeans for each meeting
eca3bed Add BlueJeans Link
[previous](slide1.md) | [next](undoing-fixing-removing.md)
# Feb 23: Don't Panic -- Gitting Unlost
---
## Undoing, Fixing, or Removing commits
Seth Robertson's excellent "Choose your own adventure"-style tutorial for
unwinding mistakes in git: https://sethrobertson.github.io/GitFixUm/fixup.html
---
### How come git status isn't always the same?
Sometimes it tells whether I'm up to date with the remote
```
$ git status
On branch tpb-rf9-dont-panic-gitting-unlost
Your branch is up-to-date with 'origin/tpb-rf9-dont-panic-gitting-unlost'.
nothing to commit, working directory clean
```
---
### How come git status isn't always the same?
But sometimes it doesn't!
```
$ git checkout untracked
$ git push origin untracked
$ git status
On branch untracked
nothing to commit, working directory clean
```
What gives?
---
### How come git status isn't always the same?
git provides the remote status when the branch is set
```
$ git push -u origin untracked
$ git status
On branch untracked
Your branch is up-to-date with 'origin/untracked'.
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment