git 初步
git command help
不知道自己怎么搞的,发现了查看git命令的详细文档的一个操作
git *** --hep就可以生成对应的html文档
eg: git config --help / git commit -help
效果图如下
git 版本控制管理
之前并没有接触过git方面的知识,在阿里实习期间才接触到git的管理流程,当时对git一无所知,师姐耐心的手把手的教我怎么使用,惭愧惭愧,在这里首先感谢我的师姐对我的帮助,之后恶补了一堆git快速入门教程,才得以在实习中有了一些进展,这几天事情不多,正好get了一本详细的git书籍,开始系统的学习了一下git
首先我是使用的windows下的git bash进行的操作,当然感觉cygwin也是不错的选择,但是自我实践,在我的电脑上git bash命令行的反应速度超级慢(延时5s~10s),网上说是os 的io缓存造成的,还有说仓库太大,还需要把360,管家等垃圾软件退了,还有更可笑的解释是时间长了就不慢了(2333),反正解决方案试了很多,没有效果,但是cygwin的反应速度特别快。但是个人还是喜欢使用git bash,because在操作的过程中发现cygwin对命令的支持程度不及git bash (eg : ll ls -l )
first 我在~目录下建立了一个目录,作为初始版本库开始进行操作
mkdir ~/public_html
cd ~/public_html
touch index.html
echo "balabala..." > index.html
git init
这样便生成了隐藏文件.git
很多配置信息都存储在.git中,这个只是针对这个版本库的配置,当然也有用户级别和系统级别的config,用户级别的放在~/.gitconfig,需要通过git --global进行配置,系统级别的我暂时没有找到,因为还没有使用到,参考资料说在/etc/gitconfig or /usr/local/etc/gitconfig,感觉在ubuntu或者debian等正常的操作系统下比较正常吧,git bash和cygwin都没有sudo这回事
中途的操作都存在了下面
Administrator@USERCHI-U2H639K MINGW64 ~
$ git status -uno
fatal: Not a git repository (or any of the parent directories): .git Administrator@USERCHI-U2H639K MINGW64 ~
$ export PATH="$HOME/bin:$PATH" Administrator@USERCHI-U2H639K MINGW64 ~
$ ll
total
lrwxrwxrwx Administrator 十月 : 「开始」菜单 -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Start Menu'/
drwxr-xr-x Administrator 十月 : AppData/
lrwxrwxrwx Administrator 十月 : 'Application Data' -> /c/Users/Administrator/AppData/Roaming/
lrwxrwxrwx Administrator 十月 : Cookies -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Cookies/
drwxr-xr-x Administrator 十月 : Desktop/
drwxr-xr-x Administrator 十月 : Documents/
drwxr-xr-x Administrator 十月 : Downloads/
drwxr-xr-x Administrator 十月 : Favorites/
drwxr-xr-x Administrator 十月 : IdeaProjects/
drwxr-xr-x Administrator 十月 : IntelGraphicsProfiles/
drwxr-xr-x Administrator 七月 Links/
lrwxrwxrwx Administrator 十月 : 'Local Settings' -> /c/Users/Administrator/AppData/Local/
drwxr-xr-x Administrator 七月 Music/
lrwxrwxrwx Administrator 十月 : 'My Documents' -> /c/Users/Administrator/Documents/
lrwxrwxrwx Administrator 十月 : NetHood -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Network Shortcuts'/
-rw-r--r-- Administrator 十月 : NTUSER.DAT
-rw-r--r-- Administrator 十月 : ntuser.dat.LOG1
-rw-r--r-- Administrator 十月 : ntuser.dat.LOG2
-rw-r--r-- Administrator 十月 : NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TM.blf
-rw-r--r-- Administrator 十月 : NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000001.regtrans-ms
-rw-r--r-- Administrator 十月 : NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000002.regtrans-ms
-rw-r--r-- Administrator 十月 : ntuser.ini
drwxr-xr-x Administrator 七月 Pictures/
lrwxrwxrwx Administrator 十月 : PrintHood -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Printer Shortcuts'/
drwxr-xr-x Administrator 十月 : public_html/
lrwxrwxrwx Administrator 十月 : Recent -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Recent/
lrwxrwxrwx Administrator 十月 : SendTo -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/SendTo/
lrwxrwxrwx Administrator 十月 : Templates -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Templates/
drwxr-xr-x Administrator 七月 Videos/
cd
Administrator@USERCHI-U2H639K MINGW64 ~
$ cd ~/p
Pictures/ PrintHood/ public_html/ Administrator@USERCHI-U2H639K MINGW64 ~
$ cd ~/public_html/ Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ ll
total
-rw-r--r-- Administrator 十月 : index.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git sta
git: 'sta' is not a git command. See 'git --help'. The most similar commands are
status
stage
stash Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git status
On branch master No commits yet Changes to be committed:
(use "git rm --cached <file>..." to unstage) new file: index.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git commit -m "Initial contents of public_html" \
> --author="baidu<arlenmbx@163.com>" *** Please tell me who you are. Run git config --global user.email "you@example.com"
git config --global user.name "Your Name" to set your account's default identity.
Omit --global to set the identity only in this repository. fatal: unable to auto-detect email address (got 'Administrator@USERCHI-U2H639K.(none)') Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git config --global user.email "arlenmbx@163.com" Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git config --global user.name "mubaixu" Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git commit -m "Initial contents of public_html" --author="baixu <arlenmbx@163.com>"
[master (root-commit) d8d6af9] Initial contents of public_html
Author: baixu <arlenmbx@.com>
file changed, insertion(+)
create mode index.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ vim
e
Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ export GIT_EDITOR=vim Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git commit -m "Initial contents of public_html" --author="baixu <arlenmbx@163.com>"
On branch master
nothing to commit, working tree clean Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git status
On branch master
nothing to commit, working tree clean Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ ll
total
-rw-r--r-- Administrator 十月 : index.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ cd .git/ Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ ll
total
-rw-r--r-- Administrator 十月 : COMMIT_EDITMSG
-rw-r--r-- Administrator 十月 : config
-rw-r--r-- Administrator 十月 : description
-rw-r--r-- Administrator 十月 : HEAD
drwxr-xr-x Administrator 十月 : hooks/
-rw-r--r-- Administrator 十月 : index
drwxr-xr-x Administrator 十月 : info/
drwxr-xr-x Administrator 十月 : logs/
drwxr-xr-x Administrator 十月 : objects/
drwxr-xr-x Administrator 十月 : refs/ Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ cd logs/ Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git/logs (GIT_DIR!)
$ ll
total
-rw-r--r-- Administrator 十月 : HEAD
drwxr-xr-x Administrator 十月 : refs/ Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git/logs (GIT_DIR!)
$ cd .. Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ ll
total
-rw-r--r-- Administrator 十月 : COMMIT_EDITMSG
-rw-r--r-- Administrator 十月 : config
-rw-r--r-- Administrator 十月 : description
-rw-r--r-- Administrator 十月 : HEAD
drwxr-xr-x Administrator 十月 : hooks/
-rw-r--r-- Administrator 十月 : index
drwxr-xr-x Administrator 十月 : info/
drwxr-xr-x Administrator 十月 : logs/
drwxr-xr-x Administrator 十月 : objects/
drwxr-xr-x Administrator 十月 : refs/
cat
Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ cat COMMIT_EDITMSG
Initial contents of public_html Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ tmux
bash: tmux: command not found Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ sudo apt-get install tmux
bash: sudo: command not found Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ apt-get install tmux
bash: apt-get: command not found Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ cd /
sudo apt
Administrator@USERCHI-U2H639K MINGW64 /
$ sudo apt-get install tmux
bash: sudo: command not found Administrator@USERCHI-U2H639K MINGW64 /
$ cd ~ Administrator@USERCHI-U2H639K MINGW64 ~
$ ll
total
lrwxrwxrwx Administrator 十月 : 「开始」菜单 -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Start Menu'/
drwxr-xr-x Administrator 十月 : AppData/
lrwxrwxrwx Administrator 十月 : 'Application Data' -> /c/Users/Administrator/AppData/Roaming/
lrwxrwxrwx Administrator 十月 : Cookies -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Cookies/
drwxr-xr-x Administrator 十月 : Desktop/
drwxr-xr-x Administrator 十月 : Documents/
drwxr-xr-x Administrator 十月 : Downloads/
drwxr-xr-x Administrator 十月 : Favorites/
drwxr-xr-x Administrator 十月 : IdeaProjects/
drwxr-xr-x Administrator 十月 : IntelGraphicsProfiles/
drwxr-xr-x Administrator 七月 Links/
lrwxrwxrwx Administrator 十月 : 'Local Settings' -> /c/Users/Administrator/AppData/Local/
drwxr-xr-x Administrator 七月 Music/
lrwxrwxrwx Administrator 十月 : 'My Documents' -> /c/Users/Administrator/Documents/
lrwxrwxrwx Administrator 十月 : NetHood -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Network Shortcuts'/
-rw-r--r-- Administrator 十月 : NTUSER.DAT
-rw-r--r-- Administrator 十月 : ntuser.dat.LOG1
-rw-r--r-- Administrator 十月 : ntuser.dat.LOG2
-rw-r--r-- Administrator 十月 : NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TM.blf
-rw-r--r-- Administrator 十月 : NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000001.regtrans-ms
-rw-r--r-- Administrator 十月 : NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000002.regtrans-ms
-rw-r--r-- Administrator 十月 : ntuser.ini
drwxr-xr-x Administrator 七月 Pictures/
lrwxrwxrwx Administrator 十月 : PrintHood -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Printer Shortcuts'/
drwxr-xr-x Administrator 十月 : public_html/
lrwxrwxrwx Administrator 十月 : Recent -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Recent/
lrwxrwxrwx Administrator 十月 : SendTo -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/SendTo/
lrwxrwxrwx Administrator 十月 : Templates -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Templates/
drwxr-xr-x Administrator 七月 Videos/ Administrator@USERCHI-U2H639K MINGW64 ~
$ cd p
bash: cd: p: No such file or directory
cd pu
Administrator@USERCHI-U2H639K MINGW64 ~
$ cd public_html/
ll Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ ll
total
-rw-r--r-- Administrator 十月 : index.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ cd .git/
ll Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ ll
total
-rw-r--r-- Administrator 十月 : COMMIT_EDITMSG
-rw-r--r-- Administrator 十月 : config
-rw-r--r-- Administrator 十月 : description
-rw-r--r-- Administrator 十月 : HEAD
drwxr-xr-x Administrator 十月 : hooks/
-rw-r--r-- Administrator 十月 : index
drwxr-xr-x Administrator 十月 : info/
drwxr-xr-x Administrator 十月 : logs/
drwxr-xr-x Administrator 十月 : objects/
drwxr-xr-x Administrator 十月 : refs/
cat c
Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ cat config
[core]
repositoryformatversion =
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
git
Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ cd .. Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ ll
total
-rw-r--r-- Administrator 十月 : index.html
vim
Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ gedit index.html
bash: gedit: command not found Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ vim index.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ cat index.html
<html>
<body>
my website is alive!
</body>
</html> Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git commit index.html
warning: LF will be replaced by CRLF in index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in index.html.
The file will have its original line endings in your working directory.
[master 8e924a2] Convert to HTML
file changed, insertions(+), deletion(-) Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git log
commit 8e924a2e7275b853ec5f66d128ff2c0933af90b7 (HEAD -> master)
Author: mubaixu <arlenmbx@.com>
Date: Sun Oct :: + Convert to HTML commit d8d6af907c50e2f546456d16be603a97da997ea4
Author: baixu <arlenmbx@.com>
Date: Sun Oct :: + Initial contents of public_html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git show 8e924a2e7275b853ec5f66d128ff2c0933af90b7
commit 8e924a2e7275b853ec5f66d128ff2c0933af90b7 (HEAD -> master)
Author: mubaixu <arlenmbx@.com>
Date: Sun Oct :: + Convert to HTML diff --git a/index.html b/index.html
index 8865c96..c9cff2d
--- a/index.html
+++ b/index.html
@@ - +, @@
-my website is alive
+<html>
+ <body>
+my website is alive!
+</body>
+</html>
+ Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git diff 8e924a2e7275b853ec5f66d128ff2c0933af90b7 d8d6af907c50e2f546456d16be603a97da997ea4
diff --git a/index.html b/index.html
index c9cff2d..8865c96
--- a/index.html
+++ b/index.html
@@ -, + @@
-<html>
- <body>
-my website is alive!
-</body>
-</html>
-
+my website is alive Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git diff 8e924a2e7275b853ec5f66d128ff2c0933af90b7 d8d6af907c50e2f546456d16be603a97da^C Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ touch poem.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ ll
total
-rw-r--r-- Administrator 十月 : index.html
-rw-r--r-- Administrator 十月 : poem.html
vim
Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ vim poem.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ cat poem.html
fuck shit Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git add poem.html poem.html
warning: LF will be replaced by CRLF in poem.html.
The file will have its original line endings in your working directory. Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git add poem.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage) new file: poem.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git commit -m "add a remove file " --author="mubaixu <arlenmbx@163.com>"
[master c742a65] add a remove file
file changed, insertion(+)
create mode poem.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git log
commit c742a65cf1e9e181719e5ae18307075ca3a10a5a (HEAD -> master)
Author: mubaixu <arlenmbx@.com>
Date: Sun Oct :: + add a remove file commit 8e924a2e7275b853ec5f66d128ff2c0933af90b7
Author: mubaixu <arlenmbx@.com>
Date: Sun Oct :: + Convert to HTML commit d8d6af907c50e2f546456d16be603a97da997ea4
Author: baixu <arlenmbx@.com>
Date: Sun Oct :: + Initial contents of public_html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git rm poem.html
rm 'poem.html' Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage) deleted: poem.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git commit -m "remove the poem.html" --author="baixu <arlenmbx@163.com>"
[master e0c3a10] remove the poem.html
Author: baixu <arlenmbx@.com>
file changed, deletion(-)
delete mode poem.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git mv index.html index_1.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage) renamed: index.html -> index_1.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git commit -m "Rename index.html to index_1.html" --author="baixu <arlenmbx@163.com>"
[master 58de85d] Rename index.html to index_1.html
Author: baixu <arlenmbx@.com>
file changed, insertions(+), deletions(-)
rename index.html => index_1.html (%) Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ cd ~ Administrator@USERCHI-U2H639K MINGW64 ~
$ git clone public_html my_website
Cloning into 'my_website'...
done. Administrator@USERCHI-U2H639K MINGW64 ~
$ ll
total
lrwxrwxrwx Administrator 十月 : 「开始」菜单 -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Start Menu'/
drwxr-xr-x Administrator 十月 : AppData/
lrwxrwxrwx Administrator 十月 : 'Application Data' -> /c/Users/Administrator/AppData/Roaming/
lrwxrwxrwx Administrator 十月 : Cookies -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Cookies/
drwxr-xr-x Administrator 十月 : Desktop/
drwxr-xr-x Administrator 十月 : Documents/
drwxr-xr-x Administrator 十月 : Downloads/
drwxr-xr-x Administrator 十月 : Favorites/
drwxr-xr-x Administrator 十月 : IdeaProjects/
drwxr-xr-x Administrator 十月 : IntelGraphicsProfiles/
drwxr-xr-x Administrator 七月 Links/
lrwxrwxrwx Administrator 十月 : 'Local Settings' -> /c/Users/Administrator/AppData/Local/
drwxr-xr-x Administrator 七月 Music/
lrwxrwxrwx Administrator 十月 : 'My Documents' -> /c/Users/Administrator/Documents/
drwxr-xr-x Administrator 十月 : my_website/
lrwxrwxrwx Administrator 十月 : NetHood -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Network Shortcuts'/
-rw-r--r-- Administrator 十月 : NTUSER.DAT
-rw-r--r-- Administrator 十月 : ntuser.dat.LOG1
-rw-r--r-- Administrator 十月 : ntuser.dat.LOG2
-rw-r--r-- Administrator 十月 : NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TM.blf
-rw-r--r-- Administrator 十月 : NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000001.regtrans-ms
-rw-r--r-- Administrator 十月 : NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000002.regtrans-ms
-rw-r--r-- Administrator 十月 : ntuser.ini
drwxr-xr-x Administrator 七月 Pictures/
lrwxrwxrwx Administrator 十月 : PrintHood -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Printer Shortcuts'/
drwxr-xr-x Administrator 十月 : public_html/
lrwxrwxrwx Administrator 十月 : Recent -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Recent/
lrwxrwxrwx Administrator 十月 : SendTo -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/SendTo/
lrwxrwxrwx Administrator 十月 : Templates -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Templates/
drwxr-xr-x Administrator 七月 Videos/ Administrator@USERCHI-U2H639K MINGW64 ~
$ ls -lsa public_html my_website
my_website:
total
drwxr-xr-x Administrator 十月 : ./
drwxr-xr-x Administrator 十月 : ../
drwxr-xr-x Administrator 十月 : .git/
-rw-r--r-- Administrator 十月 : index_1.html public_html:
total
drwxr-xr-x Administrator 十月 : ./
drwxr-xr-x Administrator 十月 : ../
drwxr-xr-x Administrator 十月 : .git/
-rw-r--r-- Administrator 十月 : index_1.html Administrator@USERCHI-U2H639K MINGW64 ~
$ diff -r public_html my_website
Only in public_html/.git: COMMIT_EDITMSG
diff -r public_html/.git/config my_website/.git/config
7a8,
> [remote "origin"]
> url = C:/Users/Administrator/public_html
> fetch = +refs/heads/*:refs/remotes/origin/*
> [branch "master"]
> remote = origin
> merge = refs/heads/master
Binary files public_html/.git/index and my_website/.git/index differ
diff -r public_html/.git/logs/HEAD my_website/.git/logs/HEAD
1,5c1
< 0000000000000000000000000000000000000000 d8d6af907c50e2f546456d16be603a97da997ea4 mubaixu <arlenmbx@163.com> 1509262561 +0800 commit (initial): Initial contents of public_html
< d8d6af907c50e2f546456d16be603a97da997ea4 8e924a2e7275b853ec5f66d128ff2c0933af90b7 mubaixu <arlenmbx@163.com> 1509263946 +0800 commit: Convert to HTML
< 8e924a2e7275b853ec5f66d128ff2c0933af90b7 c742a65cf1e9e181719e5ae18307075ca3a10a5a mubaixu <arlenmbx@163.com> 1509265185 +0800 commit: add a remove file
< c742a65cf1e9e181719e5ae18307075ca3a10a5a e0c3a100562f000856dbaa3c7b60e2fcedc81f0a mubaixu <arlenmbx@163.com> 1509265424 +0800 commit: remove the poem.html
< e0c3a100562f000856dbaa3c7b60e2fcedc81f0a 58de85d3dd141fbed0dff15a73b85de8ec7ec455 mubaixu <arlenmbx@163.com> 1509265597 +0800 commit: Rename index.html to index_1.html
---
> 0000000000000000000000000000000000000000 58de85d3dd141fbed0dff15a73b85de8ec7ec455 mubaixu <arlenmbx@163.com> 1509265847 +0800 clone: from C:/Users/Administrator/public_html
diff -r public_html/.git/logs/refs/heads/master my_website/.git/logs/refs/heads/master
1,5c1
< 0000000000000000000000000000000000000000 d8d6af907c50e2f546456d16be603a97da997ea4 mubaixu <arlenmbx@163.com> 1509262561 +0800 commit (initial): Initial contents of public_html
< d8d6af907c50e2f546456d16be603a97da997ea4 8e924a2e7275b853ec5f66d128ff2c0933af90b7 mubaixu <arlenmbx@163.com> 1509263946 +0800 commit: Convert to HTML
< 8e924a2e7275b853ec5f66d128ff2c0933af90b7 c742a65cf1e9e181719e5ae18307075ca3a10a5a mubaixu <arlenmbx@163.com> 1509265185 +0800 commit: add a remove file
< c742a65cf1e9e181719e5ae18307075ca3a10a5a e0c3a100562f000856dbaa3c7b60e2fcedc81f0a mubaixu <arlenmbx@163.com> 1509265424 +0800 commit: remove the poem.html
< e0c3a100562f000856dbaa3c7b60e2fcedc81f0a 58de85d3dd141fbed0dff15a73b85de8ec7ec455 mubaixu <arlenmbx@163.com> 1509265597 +0800 commit: Rename index.html to index_1.html
---
> 0000000000000000000000000000000000000000 58de85d3dd141fbed0dff15a73b85de8ec7ec455 mubaixu <arlenmbx@163.com> 1509265847 +0800 clone: from C:/Users/Administrator/public_html
Only in my_website/.git/logs/refs: remotes
Only in my_website/.git: packed-refs
Only in my_website/.git/refs: remotes
diff -r public_html/index_1.html my_website/index_1.html
1,6c1,6
< <html>
< <body>
< my website is alive!
< </body>
< </html>
<
---
> <html>
> <body>
> my website is alive!
> </body>
> </html>
> Administrator@USERCHI-U2H639K MINGW64 ~
$ cd public_html/ Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ cd .git/
ll Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ ll
total 13
-rw-r--r-- 1 Administrator 197121 34 十月 29 16:26 COMMIT_EDITMSG
-rw-r--r-- 1 Administrator 197121 130 十月 29 15:21 config
-rw-r--r-- 1 Administrator 197121 73 十月 29 15:21 description
-rw-r--r-- 1 Administrator 197121 23 十月 29 15:21 HEAD
drwxr-xr-x 1 Administrator 197121 0 十月 29 15:21 hooks/
-rw-r--r-- 1 Administrator 197121 145 十月 29 16:26 index
drwxr-xr-x 1 Administrator 197121 0 十月 29 15:21 info/
drwxr-xr-x 1 Administrator 197121 0 十月 29 15:36 logs/
drwxr-xr-x 1 Administrator 197121 0 十月 29 16:26 objects/
drwxr-xr-x 1 Administrator 197121 0 十月 29 15:21 refs/
cat
Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ cat config
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ cd ~/.gitconfig
bash: cd: /c/Users/Administrator/.gitconfig: Not a directory
Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ cat ~/.gitconfig
[user]
email = arlenmbx@163.com
name = mubaixu Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ cat /etc/gitconfig
cat: /etc/gitconfig: No such file or directory Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ cat /etc/.gitconfig
cat: /etc/.gitconfig: No such file or directory Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ cd /usr/local/
bash: cd: /usr/local/: No such file or directory
c
Administrator@USERCHI-U2H639K MINGW64 ~/public_html/.git (GIT_DIR!)
$ cd /usr/
ll Administrator@USERCHI-U2H639K MINGW64 /usr
$ ll
total 132
drwxr-xr-x 1 Administrator 197121 0 十月 29 14:31 bin/
drwxr-xr-x 1 Administrator 197121 0 十月 29 14:31 lib/
drwxr-xr-x 1 Administrator 197121 0 十月 29 14:31 libexec/
drwxr-xr-x 1 Administrator 197121 0 十月 29 14:31 share/
drwxr-xr-x 1 Administrator 197121 0 十月 29 14:31 ssl/ Administrator@USERCHI-U2H639K MINGW64 /usr
$ cd /etc/ Administrator@USERCHI-U2H639K MINGW64 /etc
$ ll
total 97
-rw-r--r-- 1 Administrator 197121 622 八月 31 12:22 bash.bash_logout
-rw-r--r-- 1 Administrator 197121 2339 八月 31 12:22 bash.bashrc
-rw-r--r-- 1 Administrator 197121 4196 八月 31 12:22 DIR_COLORS
-rw-r--r-- 1 Administrator 197121 1744 八月 31 12:22 docx2txt.config
-rw-r--r-- 1 Administrator 197121 271 八月 31 12:22 fstab
-rw-r--r-- 1 Administrator 197121 2627 十月 17 21:17 inputrc
-rw-r--r-- 1 Administrator 197121 218 十月 29 14:31 install-options.txt
-rw-r--r-- 1 Administrator 197121 1826 八月 31 12:22 msystem
lrwxrwxrwx 1 Administrator 197121 12 十月 29 14:31 mtab -> /proc/mounts
-rw-r--r-- 1 Administrator 197121 407 六月 11 2009 networks
-rw-r--r-- 1 Administrator 197121 211 八月 31 12:22 nsswitch.conf
-rw-r--r-- 1 Administrator 197121 3137 十月 23 22:02 package-versions.txt
drwxr-xr-x 1 Administrator 197121 0 十月 29 14:31 pkcs11/
drwxr-xr-x 1 Administrator 197121 0 十月 29 14:31 pki/
-rw-r--r-- 1 Administrator 197121 6578 八月 31 12:22 profile
drwxr-xr-x 1 Administrator 197121 0 十月 29 14:31 profile.d/
-rw-r--r-- 1 Administrator 197121 1358 六月 11 2009 protocols
-rw-r--r-- 1 Administrator 197121 17463 六月 11 2009 services
drwxr-xr-x 1 Administrator 197121 0 十月 29 14:31 ssh/
-rw-r--r-- 1 Administrator 197121 16596 十月 4 07:09 tigrc
-rw-r--r-- 1 Administrator 197121 2285 十月 17 21:17 vimrc Administrator@USERCHI-U2H639K MINGW64 /etc
$ git config -l
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslcainfo=D:/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
credential.helper=manager
user.email=arlenmbx@163.com
user.name=mubaixu Administrator@USERCHI-U2H639K MINGW64 /etc
$ cat ~/public_html/.git/config
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true Administrator@USERCHI-U2H639K MINGW64 /etc
$ git config --help Administrator@USERCHI-U2H639K MINGW64 /etc
$ git config --global alias.show-graph 'commit -m "this is a simple commit ^C cd ~ Administrator@USERCHI-U2H639K MINGW64 /etc
$ cd ~ Administrator@USERCHI-U2H639K MINGW64 ~
$ ll
total 3413
lrwxrwxrwx 1 Administrator 197121 67 十月 10 15:14 「开始」菜单 -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Start Menu'/
drwxr-xr-x 1 Administrator 197121 0 十月 10 15:14 AppData/
lrwxrwxrwx 1 Administrator 197121 38 十月 10 15:14 'Application Data' -> /c/Users/Administrator/AppData/Roaming/
lrwxrwxrwx 1 Administrator 197121 64 十月 10 15:14 Cookies -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Cookies/
drwxr-xr-x 1 Administrator 197121 0 十月 29 14:33 Desktop/
drwxr-xr-x 1 Administrator 197121 0 十月 17 12:28 Documents/
drwxr-xr-x 1 Administrator 197121 0 十月 29 14:47 Downloads/
drwxr-xr-x 1 Administrator 197121 0 十月 10 15:17 Favorites/
drwxr-xr-x 1 Administrator 197121 0 十月 26 16:19 IdeaProjects/
drwxr-xr-x 1 Administrator 197121 0 十月 29 12:13 IntelGraphicsProfiles/
drwxr-xr-x 1 Administrator 197121 0 七月 14 2009 Links/
lrwxrwxrwx 1 Administrator 197121 36 十月 10 15:14 'Local Settings' -> /c/Users/Administrator/AppData/Local/
drwxr-xr-x 1 Administrator 197121 0 七月 14 2009 Music/
lrwxrwxrwx 1 Administrator 197121 32 十月 10 15:14 'My Documents' -> /c/Users/Administrator/Documents/
drwxr-xr-x 1 Administrator 197121 0 十月 29 16:30 my_website/
lrwxrwxrwx 1 Administrator 197121 74 十月 10 15:14 NetHood -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Network Shortcuts'/
-rw-r--r-- 1 Administrator 197121 2097152 十月 29 16:56 NTUSER.DAT
-rw-r--r-- 1 Administrator 197121 262144 十月 29 16:56 ntuser.dat.LOG1
-rw-r--r-- 1 Administrator 197121 0 十月 10 15:13 ntuser.dat.LOG2
-rw-r--r-- 1 Administrator 197121 65536 十月 10 15:15 NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TM.blf
-rw-r--r-- 1 Administrator 197121 524288 十月 10 15:15 NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000001.regtrans-ms
-rw-r--r-- 1 Administrator 197121 524288 十月 10 15:15 NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000002.regtrans-ms
-rw-r--r-- 1 Administrator 197121 20 十月 10 15:14 ntuser.ini
drwxr-xr-x 1 Administrator 197121 0 七月 14 2009 Pictures/
lrwxrwxrwx 1 Administrator 197121 74 十月 10 15:14 PrintHood -> '/c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Printer Shortcuts'/
drwxr-xr-x 1 Administrator 197121 0 十月 29 16:25 public_html/
lrwxrwxrwx 1 Administrator 197121 63 十月 10 15:14 Recent -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Recent/
lrwxrwxrwx 1 Administrator 197121 63 十月 10 15:14 SendTo -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/SendTo/
lrwxrwxrwx 1 Administrator 197121 66 十月 10 15:14 Templates -> /c/Users/Administrator/AppData/Roaming/Microsoft/Windows/Templates/
drwxr-xr-x 1 Administrator 197121 0 七月 14 2009 Videos/
cd pub
Administrator@USERCHI-U2H639K MINGW64 ~
$ cd public_html/
ll Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ ll
gittotal 1
-rw-r--r-- 1 Administrator 197121 53 十月 29 15:57 index_1.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git config --global alias.show-graph 'commit -m "this is a simpe commit !" --author="test <arlenmbx@163.com>"' Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ l
bash: l: command not found
ll Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ ll
total 1
-rw-r--r-- 1 Administrator 197121 53 十月 29 15:57 index_1.html
touch
Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ touch test.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ vim test.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git add test.html
git warning: LF will be replaced by CRLF in test.html.
The file will have its original line endings in your working directory.
stat
Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage) new file: test.html git
Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git show-graph
[master 3cdbfbd] this is a simpe commit !
Author: test <arlenmbx@163.com>
1 file changed, 2 insertions(+)
create mode 100644 test.html Administrator@USERCHI-U2H639K MINGW64 ~/public_html (master)
$ git log
commit 3cdbfbd6ed20942a4ba0c64aec274397ca5e74f2 (HEAD -> master)
Author: test <arlenmbx@163.com>
Date: Sun Oct 29 17:03:16 2017 +0800 this is a simpe commit ! commit 58de85d3dd141fbed0dff15a73b85de8ec7ec455
Author: baixu <arlenmbx@163.com>
Date: Sun Oct 29 16:26:37 2017 +0800 Rename index.html to index_1.html commit e0c3a100562f000856dbaa3c7b60e2fcedc81f0a
Author: baixu <arlenmbx@163.com>
Date: Sun Oct 29 16:23:44 2017 +0800 remove the poem.html commit c742a65cf1e9e181719e5ae18307075ca3a10a5a
Author: mubaixu <arlenmbx@163.com>
Date: Sun Oct 29 16:19:45 2017 +0800 add a remove file commit 8e924a2e7275b853ec5f66d128ff2c0933af90b7
Author: mubaixu <arlenmbx@163.com>
Date: Sun Oct 29 15:59:06 2017 +0800 Convert to HTML commit d8d6af907c50e2f546456d16be603a97da997ea4
Author: baixu <arlenmbx@163.com>
Date: Sun Oct 29 15:36:01 2017 +0800 Initial contents of public_html
(1)个人感觉最后一个配置别名的操作很棒,简化了很多流程
(2)git mv 其实可以通过mv -> git rm ->git add实现
(3)git config 不加global可以针对当前版本库进行配置,覆盖用户级别的config
(4)clone后的差别可以通过ls -lsa查看,或者通过diff -r递归的逐个文件的查看
(5)git log 有针对性的可以使用 git show ID / git show-branch --more=count
------其他的都是比较基础的固定性命令了
git 初步的更多相关文章
- git初步使用
git初步使用 主要目的:使用代码控制工具,练习使用git 1.创建新项目 网址如下: https://github.com/kellyseeme?tab=repositories 注意每个人使用的名 ...
- Git初步学习
版本控制系统version control system 多人协作开发 历史记录 恢复到任意历史版本-代码状态 错误恢复 多功能并行开发 版本控制系统分类: 本地版本控制系统---------个人计算 ...
- git初步使用总结
今天时隔大半年之后再一次接触了git,发现在这学期学习过一点linux之后,对git的学习变得感觉一切都是那么理所当然. 下面仅仅是罗列一下我的学习笔记. 1.下载git可以到百度软件库下载,一般都可 ...
- git初步用法
三. Gerrit的注册及使用 1. 简介 Gerrit为代码审核工具,git提交的代码,必须经过审核才能合入到正式的版本库中. 2. 注册步骤 (1) ...
- Git初步
在多人参与开发的项目中,版本控制工具是必须的,网上有很多不错的教程,能简单使用就ok了,粘几篇教程,方便学习 首先我们要了解一些基本的概念,此处简单描述一下 (1)集中式版本控制系统: CVS.SVN ...
- [git更新中]版本控制工具git初步使用
逐渐开始写规模稍大的程序, 如果在像以前一样每写完一次保存一个版本, 修改起来太蛋疼了, 而且还会忘记都有修改过哪里, 最终如果写完的话, 各种不方便, 于是便开始接触版本控制工具. 因为是在Linu ...
- Git初步配置 ubuntu服务器 windows客户端 虚拟机
最近自己配置了一下Git,虽然网上相关的内容满天飞(ps:大多都差不多,很多都是直接转载,说的也比较乱),但是我还是碰到了很多问题,这里我就把我配置的步骤分享一下,遇到的问题也说一下,新手之间相互学习 ...
- git初步研究2
$git init Git 使用 git init 命令来初始化一个 Git 仓库,Git 的很多命令都需要在 Git 的仓库中运行,所以 git init 是使用 Git 的第一个命令. 在执行完成 ...
- node安装 教程 + git初步
我的系统是win8.1 64位 这个是对应的安装包:http://files.cnblogs.com/files/zxyun/node-v0.12.5-x64.zip 安装中有不懂可以参考下面的两 ...
随机推荐
- linux下svn命令大全(转)
1.将文件checkout到本地目录 svn checkout path(path是服务器上的目录) 例如:svn checkout svn://192.168.1.1/pro/domain 简写:s ...
- 软件测试的cookie测试
1.什么是cooike测试 Cookie是指网站用于辨别身份,进行会话(session)跟踪而存储在客户端的数据.它是有服务器产生并发送给客户端的.其用途是提供一个方便的功能以简化用户输入,节省访问页 ...
- SQL Server安装【转载】
http://blog.csdn.net/sangjinchao/article/details/62044021?locationNum=6&fps=1
- 编译Linux-4.9.9内核流程记录
本文部分资料出自: http://www.cnblogs.com/xiaocen/p/3717993.html 首先下载代码: https://www.kernel.org/pub/linux/ker ...
- Windows下chm转换为html的超简单方法
摘要:通过调用Windows命令,将chm 文件转换为html 文件 概述:很多程序员朋友都会遇到这样的问题,看一个离线版的帮助文档(chm文件),总会产生一个索引文件(该文件的chw文件), 而且有 ...
- 【京东账户】——Mysql/PHP/Ajax爬坑之页头页尾加载
一.引言 实现京东的账户项目,有一个小功能,页头页尾加载.要用到的是Apach环境,Mysql.PHP以及Ajax. 二.实现 原理: 用php文件分别写一个的页头和一个页尾,放在前后两个div里. ...
- java 反射 类装载器
前言: java语言允许通过程序化的方式间接对Class进行操作,Class文件由类装载器装载后,在jvm中将形成一份描述Class结构的元信息对象,通过该元信息对象可以获知Class的结构信息,如构 ...
- SqlHelper工具类
public class SqlHlper { public static readonly string constr = ConfigurationManager.ConnectionString ...
- HCatalog
HCatalog HCatalog是Hadoop中的表和存储管理层,能够支持用户用不同的工具(Pig.MapReduce)更容易地表格化读写数据. HCatalog从Apache孵化器毕业,并于201 ...
- [ASP.NET教程] 防止表单重复提交
第一种方法:javascript控制.缺点,一般用户使用没问题,但是懂点js的还是可以强行重复提交.而且,后退再提交,你也没啥办法.第二种方法:服务器控制.后台生成一个token,存入session或 ...