Last active
October 4, 2019 01:46
-
-
Save zbal/6172020 to your computer and use it in GitHub Desktop.
rename - delete - create -- git ...
This file contains 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
Vincents-MacBook-Pro:sandbox balou$ git init | |
Initialized empty Git repository in /Users/balou/workspace/sandbox/.git/ | |
Vincents-MacBook-Pro:sandbox balou$ vim a | |
Vincents-MacBook-Pro:sandbox balou$ cat a | |
aaaaa | |
Vincents-MacBook-Pro:sandbox balou$ git add a | |
Vincents-MacBook-Pro:sandbox balou$ git status | |
# On branch master | |
# | |
# Initial commit | |
# | |
# Changes to be committed: | |
# (use "git rm --cached <file>..." to unstage) | |
# | |
# new file: a | |
# | |
Vincents-MacBook-Pro:sandbox balou$ git commit -am 'Add a' | |
[master (root-commit) c636156] Add a | |
1 file changed, 1 insertion(+) | |
create mode 100644 a | |
Vincents-MacBook-Pro:sandbox balou$ git rm a | |
rm 'a' | |
Vincents-MacBook-Pro:sandbox balou$ vim b | |
Vincents-MacBook-Pro:sandbox balou$ cat b | |
aaaaa | |
b | |
Vincents-MacBook-Pro:sandbox balou$ git add b | |
Vincents-MacBook-Pro:sandbox balou$ ls | |
b | |
Vincents-MacBook-Pro:sandbox balou$ git status | |
# On branch master | |
# Changes to be committed: | |
# (use "git reset HEAD <file>..." to unstage) | |
# | |
# renamed: a -> b | |
# | |
Vincents-MacBook-Pro:sandbox balou$ git commit -am 'Deleted a and created b with similar content' | |
[master add9d5a] Deleted a and created b with similar content | |
1 file changed, 1 insertion(+) | |
rename a => b (75%) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment