22. stá pasando?
¿Qué e
> git status
#
#
#
#
#
#
#
#
#
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
the-hobbit.txt
nothing added to commit but untracked files present
use "git add" to track
23. stá pasando?
¿Qué e
> git status --short --branch --untracked-files=normal
## Initial commit on 'master' branch
?? the-hobbit.txt
24. primer commit
Mi
> git add -A
> git commit
> git commit -a -m "Not a dwarf's story" --edit
[master (root-commit) 7b092a2] Not a dwarf's story
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 the-hobbit.txt
HEAD
master
7b09
25. de un commit
Anatomía
> git log -1
commit 7b092a2be4f147aa7878cb37e1228a5c38cd3949
Author: John Ronald Reuel Tolkien <root@middle-earth.com>
Date:
Wed Aug 14 13:20:19 1922 +0100
Not a dwarf's story
I put some trolls too. And elves with pointy ears.
Not sure about the whole thing with the ring, though.
HEAD
master
7b09
27. Branches
> git branch "dragon" HEAD
> git checkout "dragon"
> git checkout -b "dragon"
HEAD
dragon
master
7b09
28. Indexando
> git add "the-hobbit.txt"
> git commit -m "Enter Pryftan, the motherfu**ing dragon"
HEAD
dragon
master
7b09
69d2
29. ¿Corregimos?
> sed -i "s/Pryftan/Smaug/g" "the-hobbit.txt"
> git add "the-hobbit.txt"
> git commit --amend -m "Enter Smaug, the motherfu**ing dragon"
HEAD
dragon
master
7b09
69d2
1c6a
30. Diferencias
> git diff 7b09
diff --git i/the-hobbit.txt w/the-hobbit.txt
--- i/the-hobbit.txt
+++ w/the-hobbit.txt
@@ -1 +1 @@
-Pryftan really did laugh, a devastating sound which shook Bilbo to the floor
+Smaug really did laugh, a devastating sound which shook Bilbo to the floor
HEAD
dragon
master
7b09
69d2
1c6a
37. own à la GitHub
Markd
●
●
●
●
Filtro de texto plano a HTML
Mejoras GitHub
Específicas GitHub
Emojis!
38. Shortcuts
[?]
[s]
[j]
[g]
[t]
[w]
es tu tecla amiga
/ [/] busca en tus repos/repo actual
/ [k] selección arriba/abajo
+ [c] / [i] / [p] ir al código/issues/PRs
buscar por nombre de fichero
cambiar rama
43. de encuentro
Punto
> git merge-base master dragon
7b092a2be4f147aa7878cb37e1228a5c38cd3949
dragon
1c6a
7b09
HEAD
master
5b3f
a9af
62e3
44. tando commits
Lis
> git log --graph --decorate --pretty=oneline
* b964a8d (dragon) Merged Edith fixes
|
| * 62e3342 (endor/heru) Rewording for better readability
| * a9af710 Fixed typos in first draft
* | 5b3ffe4 Add more dwarfs
* | 1c6ad34 Enter Smaug, the motherfu**ing dragon
|/
* 7b092a2 Not a dwarf's story
45. tando commits
Lis
> git log -S "Gandalf" --pretty="%h %s by %aN %ar"
62e3342 Rewording for better readability by JRRTolkien 2 hours ago
7b092a2 Not a dwarf's story by JRRTolkien 3 days ago
> git log --oneline -- LICENSE
7b092a2 Not a dwarf's story
47. ando la historia
Cambi
> git rebase "7b09" "dragon" --onto "master"
dragon
1c6a
HEAD
master
5b3f
692e
7b09
a9af
HEAD
dragon
master
7b09
a9af
62e3
62e3
12b3
48c2
48. quito a poco
Po
> git checkout master
> git cherry-pick 1c6a 5b3f
dragon
1c6a
HEAD
master
5b3f
7b09
a9af
62e3
HEAD
master
12b3
48c2
HEAD
master
dragon
7b09
a9af
62e3
12b3
48c2
49. Marcha atrás
> git checkout -f HEAD
> git reset --hard
> git clean -df
> git revert "a9af"
> git rebase --interactive HEAD "a9af"~
50. interactivo
Rebase
> git rebase --interactive 7b09 dragon
pick 5b3f Bilbo is chased by the dragon
pick 1c6a Dragon description
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
51. El alijo…
> git stash -u -k
> git lol stash@{0}
*-. f571325 WIP on master:
|
| | * b4bea53 untracked files on master:
| * a9af710 index on master:
|/
* 012f62b (master) Enter Smaug, the motherfu**ing dragon
…
> git stash apply
> git stash drop
> git stash pop
52. Reflog
> git reflog dragon
ab4a dragon@{0}: rebase finished: refs/heads/dragon onto ab4a
5b3f dragon@{1}: reset: moving to HEAD~
b964 dragon@{2}: pull endor heru: Merge made by the 'recursive' strategy.
53. Alias
> git config alias.lol "log --graph --decorate --oneline" --global
> git lol
* b964a8d (dragon)
|
| * 62e3342 (endor/heru) Rewording for better readability
| * a9af710 Fixed typos in first draft
* | 5b3ffe4 Add more dwarfs
* | 1c6ad34 Enter Smaug, the motherfu**ing dragon
|/
* 7b092a2 Not a dwarf's story
54. Alias
> git config alias.replay '!f() {
git rebase "$(git merge-base HEAD "$1")" "$1" --onto HEAD
}; f'
> git replay dragon
56. THE END
jugo a GIT
Sacándole
ocalipsis
ervivencia para el ap
Manual de sup
// Porque con zombies todo suena más molón
// TO DO: Añadir zombies
zombie