Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- C:\git> ls
- C:\git> git init
- Initialized empty Git repository in C:/git/.git/
- C:\git [master]> echo "hello" | git hash-object --stdin
- ef0493b275aa2080237f676d2ef6559246f56636
- C:\git [master]> echo "hello" | git hash-object --stdin -w
- ef0493b275aa2080237f676d2ef6559246f56636
- C:\git [master]> git cat-file ef0493b275aa2080237f676d2ef6559246f56636 -p
- hello
- C:\git [master]> git cat-file ef0493b275aa2080237f676d2ef6559246f56636 -t
- blob
- C:\git [master]> git add .
- C:\git [master +1 ~0 -0 ~]> git commit -m "hello wofld"
- [master (root-commit) 48c8e49] hello wofld
- 1 file changed, 1 insertion(+)
- create mode 100644 hi.txt
- C:\git [master]> git cat-file 48c8e49 -p
- tree 605953bb9d6bed60e6fb1d578cc98cbc64ea8294
- author Casey Allen <casey.allen@readify.net> 1527136127 +0800
- committer Casey Allen <casey.allen@readify.net> 1527136127 +0800
- hello wofld
- C:\git [master]> git cat-file -p 605953bb9d6bed60e6fb1d578cc98cbc64ea8294
- 100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad hi.txt
- C:\git [master]> git add .
- C:\git [master +1 ~0 -0 ~]> git commit -m "hi 1"
- [master 4fdeea7] hi 1
- 1 file changed, 1 insertion(+)
- create mode 100644 hi.1.txt
- C:\git [master]> git add .
- C:\git [master +1 ~0 -0 ~]> git commit -m "foo"
- [master d7ba688] foo
- 1 file changed, 1 insertion(+)
- create mode 100644 foo/foo.txt
- C:\git [master]> git cat-file -p d7ba688
- tree 63e1863f16382c5a18e7a6f29f304d92923deff5
- parent 4fdeea75c35ec13a971d204e653e73aa059d5b37
- author Casey Allen <casey.allen@readify.net> 1527136365 +0800
- committer Casey Allen <casey.allen@readify.net> 1527136365 +0800
- foo
- C:\git [master]> git add .
- C:\git [master +0 ~1 -0 ~]> git commit -m "dfd"
- [master 64935fc] dfd
- 1 file changed, 1 insertion(+)
- C:\git [master]> git co 4fde
- Note: checking out '4fde'.
- You are in 'detached HEAD' state. You can look around, make experimental
- changes and commit them, and you can discard any commits you make in this
- state without impacting any branches by performing another checkout.
- If you want to create a new branch to retain commits you create, you may
- do so (now or later) by using -b with the checkout command again. Example:
- git checkout -b <new-branch-name>
- HEAD is now at 4fdeea7... hi 1
- C:\git [(4fdeea7...)]> git add .
- C:\git [(4fdeea7...) +0 ~1 -0 ~]> git commit -m "hi dfd"
- [detached HEAD d881a7a] hi dfd
- 1 file changed, 1 insertion(+)
- C:\git [(d881a7a...)]> git merge master
- Merge made by the 'recursive' strategy.
- foo/foo.txt | 2 ++
- 1 file changed, 2 insertions(+)
- create mode 100644 foo/foo.txt
- C:\git [(17010aa...)]> git cat-file -p 17010
- tree 1ab7c0dc45519f72b756f9b059018e0c243b8355
- parent d881a7a4149aed31baae0444fc2fcb4781ad5e4b
- parent 64935fce45df36a3677c8b4ca76e711a57737ed6
- author Casey Allen <casey.allen@readify.net> 1527136717 +0800
- committer Casey Allen <casey.allen@readify.net> 1527136717 +0800
- Merge branch 'master' into HEAD
- C:\git [(17010aa...)]> git add .
- C:\git [(17010aa...) +0 ~1 -0 ~]> git commit -m "detached"
- [detached HEAD e2cd55d] detached
- 1 file changed, 1 insertion(+), 1 deletion(-)
- C:\git [(e2cd55d...)]> git co master
- Warning: you are leaving 3 commits behind, not connected to
- any of your branches:
- e2cd55d detached
- 17010aa Merge branch 'master' into HEAD
- d881a7a hi dfd
- If you want to keep them by creating a new branch, this may be a good time
- to do so with:
- git branch <new-branch-name> e2cd55d
- Switched to branch 'master'
- C:\git [master]> git add .
- C:\git [master +0 ~1 -0 ~]> git commit -m "on master"
- [master 7f6ab8c] on master
- 1 file changed, 1 insertion(+)
- C:\git [master]> git merge e2cd
- Auto-merging hi.txt
- CONFLICT (content): Merge conflict in hi.txt
- Automatic merge failed; fix conflicts and then commit the result.
- C:\git [master +0 ~0 -0 !1 | +0 ~0 -0 !1 !]> git st
- On branch master
- You have unmerged paths.
- (fix conflicts and run "git commit")
- (use "git merge --abort" to abort the merge)
- Unmerged paths:
- (use "git add <file>..." to mark resolution)
- both modified: hi.txt
- no changes added to commit (use "git add" and/or "git commit -a")
- C:\git [master +0 ~0 -0 !1 | +0 ~0 -0 !1 !]> git add .
- C:\git [master +0 ~1 -0 ~]> git commit -m "merge commit"
- [master 7b419b4] merge commit
- C:\git [master]> git co -b feature
- Switched to a new branch 'feature'
- C:\git [feature]> git co master
- Switched to branch 'master'
- C:\git [master]> git co feature
- Switched to branch 'feature'
- C:\git [feature]> git add.
- git: 'add.' is not a git command. See 'git --help'.
- The most similar command is
- add
- C:\git [feature +1 ~0 -0 !]> git add .
- C:\git [feature +1 ~0 -0 ~]> git commit -m "feature1"
- [feature 21b4181] feature1
- 1 file changed, 1 insertion(+)
- create mode 100644 foo/feature/file1
- C:\git [feature]> git add .
- C:\git [feature +0 ~1 -0 ~]> git commit -m "feature2"
- [feature a3bbbfd] feature2
- 1 file changed, 1 insertion(+)
- C:\git [feature]> git co master
- Switched to branch 'master'
- C:\git [master]> git add .
- C:\git [master +0 ~1 -0 ~]> git commit -m "master 23343"
- [master faaaae8] master 23343
- 1 file changed, 1 insertion(+)
- C:\git [master]> git co feature
- Switched to branch 'feature'
- C:\git [feature]> git rebase master -i
- Successfully rebased and updated refs/heads/feature.
- C:\git [feature]> git co a3bbb
- Note: checking out 'a3bbb'.
- You are in 'detached HEAD' state. You can look around, make experimental
- changes and commit them, and you can discard any commits you make in this
- state without impacting any branches by performing another checkout.
- If you want to create a new branch to retain commits you create, you may
- do so (now or later) by using -b with the checkout command again. Example:
- git checkout -b <new-branch-name>
- HEAD is now at a3bbbfd... feature2
- C:\git [(a3bbbfd...)]> git branch remember
- C:\git [(a3bbbfd...)]> git co master
- Previous HEAD position was a3bbbfd... feature2
- Switched to branch 'master'
- C:\git [master]> git reflog
- faaaae8 (HEAD -> master) HEAD@{0}: checkout: moving from a3bbbfd960ea0ead9f4f689612d80a4360b55921 to master
- a3bbbfd (remember) HEAD@{1}: checkout: moving from feature to a3bbb
- 1297fca (feature) HEAD@{2}: rebase -i (finish): returning to refs/heads/feature1297fca (feature) HEAD@{3}: rebase -i (pick): feature2
- f194ac7 HEAD@{4}: rebase -i (pick): feature1
- faaaae8 (HEAD -> master) HEAD@{5}: rebase -i (start): checkout master
- a3bbbfd (remember) HEAD@{6}: checkout: moving from master to feature
- faaaae8 (HEAD -> master) HEAD@{7}: commit: master 23343
- 7b419b4 HEAD@{8}: checkout: moving from feature to master
- a3bbbfd (remember) HEAD@{9}: commit: feature2
- 21b4181 HEAD@{10}: commit: feature1
- 7b419b4 HEAD@{11}: checkout: moving from master to feature
- 7b419b4 HEAD@{12}: checkout: moving from feature to master
- 7b419b4 HEAD@{13}: checkout: moving from master to feature
- 7b419b4 HEAD@{14}: commit (merge): merge commit
- 7f6ab8c HEAD@{15}: commit: on master
- 64935fc HEAD@{16}: checkout: moving from e2cd55d6b9241edbbcab5fa895b193199f9980f2 to master
- e2cd55d HEAD@{17}: commit: detached17010aa HEAD@{18}: merge master: Merge made by the 'recursive' strategy.
- C:\git [master]>
- C:\git [master]> git config -e --global
- C:\git [master]> git co remember
- Switched to branch 'remember'
- C:\git [remember]> git behind master
- 1
- C:\git [remember]> git lg
- * a3bbbfd <Casey Allen> - (HEAD -> remember) feature2 (16 minutes ago)
- * 21b4181 <Casey Allen> - feature1 (17 minutes ago)
- * 7b419b4 <Casey Allen> - merge commit (21 minutes ago)
- |\
- | * e2cd55d <Casey Allen> - detached (23 minutes ago)
- | * 17010aa <Casey Allen> - Merge branch 'master' into HEAD (26 minutes ago)o)
- | |\
- | * | d881a7a <Casey Allen> - hi dfd (26 minutes ago)
- * | | 7f6ab8c <Casey Allen> - on master (22 minutes ago)
- | |/
- |/|
- * | 64935fc <Casey Allen> - dfd (28 minutes ago)
- * | d7ba688 <Casey Allen> - foo (32 minutes ago)
- |/
- * 4fdeea7 <Casey Allen> - hi 1 (33 minutes ago)
- * 48c8e49 <Casey Allen> - hello wofld (35 minutes ago)
- C:\git [remember]> git add .
- C:\git [remember +0 ~1 -0 ~]> git stash push
- Saved working directory and index state WIP on remember: a3bbbfd feature2
- C:\git [remember]> git status
- On branch remember
- nothing to commit, working tree clean
- C:\git [remember]> git stash pop
- On branch remember
- Changes not staged for commit:
- (use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
- modified: hi.txt
- no changes added to commit (use "git add" and/or "git commit -a")
- C:\git [remember +0 ~1 -0 !]> git cat-file -p 80e9
- tree fcd41781597e44f2f33af61a8572eac89ab2ca47
- parent a3bbbfd960ea0ead9f4f689612d80a4360b55921
- author Casey Allen <casey.allen@readify.net> 1527138285 +0800
- committer Casey Allen <casey.allen@readify.net> 1527138285 +0800
- index on remember: a3bbbfd feature2
- C:\git [remember +0 ~1 -0 !]> git cat-file -p dd07
- tree fcd41781597e44f2f33af61a8572eac89ab2ca47
- parent a3bbbfd960ea0ead9f4f689612d80a4360b55921
- parent 80e96b8f66a648e494293d37d52f3c10a02d6f1f
- author Casey Allen <casey.allen@readify.net> 1527138285 +0800
- committer Casey Allen <casey.allen@readify.net> 1527138285 +0800
- WIP on remember: a3bbbfd feature2
- C:\git [remember +0 ~1 -0 !]> git stash list
- C:\git [remember +0 ~1 -0 !]> git add .
- C:\git [remember +0 ~1 -0 ~]> git stash save "stash_1"
- Saved working directory and index state On remember: stash_1
- C:\git [remember]> git cat-file -p ef4c
- tree fcd41781597e44f2f33af61a8572eac89ab2ca47
- parent a3bbbfd960ea0ead9f4f689612d80a4360b55921
- parent 5fb2029ba5ce474ffb7b19065a6781902d5d7f67
- author Casey Allen <casey.allen@readify.net> 1527138427 +0800
- committer Casey Allen <casey.allen@readify.net> 1527138427 +0800
- On remember: stash_1
Add Comment
Please, Sign In to add comment