Created
June 26, 2018 17:43
-
-
Save yurug/d067f23c5dea0b85b63d73ff646e13d9 to your computer and use it in GitHub Desktop.
Git branches
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yann➜/tmp» cd test-git [19:39:38] | |
yann➜/tmp/test-git» ls [19:39:40] | |
yann➜/tmp/test-git» git init [19:39:40] | |
Initialized empty Git repository in /tmp/test-git/.git/ | |
yann➜/tmp/test-git(master)» mkdir a [19:39:42] | |
yann➜/tmp/test-git(master)» touch a/b [19:39:44] | |
yann➜/tmp/test-git(master✗)» git add a/b [19:39:47] | |
yann➜/tmp/test-git(master✗)» git commit -a -m 'a/b is in master' [19:39:54] | |
[master (root-commit) f2e2b93] a/b is in master | |
1 file changed, 0 insertions(+), 0 deletions(-) | |
create mode 100644 a/b | |
yann➜/tmp/test-git(master)» git checkout -b mybranch [19:40:00] | |
Switched to a new branch 'mybranch' | |
yann➜/tmp/test-git(mybranch)» r m-fr a/b [19:40:09] | |
fc: event not found: m-fr | |
yann➜/tmp/test-git(mybranch)» rm -fr a/b [19:40:12] | |
yann➜/tmp/test-git(mybranch✗)» git commit -a -m 'a/b is not in mybranch' [19:40:14] | |
[mybranch 759e5e6] a/b is not in mybranch | |
1 file changed, 0 insertions(+), 0 deletions(-) | |
delete mode 100644 a/b | |
yann➜/tmp/test-git(mybranch)» git checkout master [19:40:24] | |
Switched to branch 'master' | |
yann➜/tmp/test-git(master)» ls [19:40:29] | |
a | |
yann➜/tmp/test-git(master)» ls a [19:40:29] | |
b | |
yann➜/tmp/test-git(master)» git checkout mybranch [19:40:35] | |
Switched to branch 'mybranch' | |
yann➜/tmp/test-git(mybranch)» ls [19:42:09] | |
yann➜/tmp/test-git(mybranch)» [19:42:10] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment