Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1559258
  • 博文数量: 327
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 3556
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-05 21:28
个人简介

东黑布衣,流浪幽燕。 真诚善良,值得信赖。

文章分类

全部博文(327)

我的朋友

分类: BSD

2017-10-11 08:38:49

Windows 下的安装



打开Gitbash,
在/c/Users//目录下也有一个
.gitconfig文件,可以直接修改该文件




  1. $ git config --global user.name "clz"


  2. $ git config --global user.email "clz@263.net"


  3. $ git config --list
  4. core.symlinks=false
  5. core.autocrlf=true
  6. core.fscache=true
  7. color.diff=auto
  8. color.status=auto
  9. color.branch=auto
  10. color.interactive=true
  11. help.format=html
  12. rebase.autosquash=true
  13. http.sslcainfo=C:/PROG/Git/mingw64/ssl/certs/ca-bundle.crt
  14. http.sslbackend=openssl
  15. diff.astextplain.textconv=astextplain
  16. filter.lfs.clean=git-lfs clean -- %f
  17. filter.lfs.smudge=git-lfs smudge -- %f
  18. filter.lfs.required=true
  19. filter.lfs.process=git-lfs filter-process
  20. credential.helper=manager
  21. user.name=clz
  22. user.email=clz@163.net


  23. $



  1. $ ls
  2. 1122Tesst/ 20161116/ acm01_0503/ ADV/ ADV07/ aha0401/ aha0701/ bubble/ Readme.md
  3. 20160810/ 20170407Test/ acm01_0701/ ADV01/ ADV09/ aha0403/ aha0702/ CSDN/ Temp/
  4. 20160928/ 20170419adv/ acm02_0107/ ADV03/ adv09_simple_plate/ aha0404/ aha0703/ day02/ VSMacros80/
  5. 20160928adv/ 20170426adv/ acm02_0408/ ADV04/ aha_quicksort/ aha0410/ aha0804/ DijkstraCU/ 新建文件夹/
  6. 20161019/ 20170517adv/ acm02_0408-2/ ADV05/ aha0205/ aha0501/ AIC/ Intermediate/
  7. 20161026/ 20170524adv/ acm0301/ ADV06/ aha0206/ aha0602/ binary_tree_01/ Mac2Unix.c
  8. git

  9. $ git add Readme.md


  10. $ git commit -m "add a readme file"
  11. [master (root-commit) 1e0ebaf] add a readme file
  12.  1 file changed, 1 insertion(+)
  13.  create mode 100644 Readme.md


  14. $



  1. $ git init
  2. Initialized empty Git repository in D:/VS_PROG/git_test/.git/


  3. $ git status
  4. On branch master

  5. No commits yet

  6. nothing to commit (create/copy files and use "git add" to track)


  7. $ git add Readme.md


  8. $ git commit -m "add a readme file"
  9. [master (root-commit) 60826d5] add a readme file
  10.  1 file changed, 1 insertion(+)
  11.  create mode 100644 Readme.md


  12. $ git status
  13. On branch master
  14. nothing to commit, working tree clean

  15. //新建一个LICENSE文件

  16. $ git status
  17. On branch master
  18. Untracked files:
  19.   (use "git add ..." to include in what will be committed)

  20.         LICENSE

  21. nothing added to commit but untracked files present (use "git add" to track)


  22. $ git add LICENSE


  23. $ git status
  24. On branch master
  25. Changes to be committed:
  26.   (use "git reset HEAD ..." to unstage)

  27.         new file: LICENSE



  28. $ git reset HEAD   //将最后一个文件返回到modified状态,也可以明确指定哪个文件


  29. $ git status
  30. On branch master
  31. Untracked files:
  32.   (use "git add ..." to include in what will be committed)

  33.         LICENSE

  34. nothing added to commit but untracked files present (use "git add" to track)


  35. $ git add LICENSE


  36. $ git status
  37. On branch master
  38. Changes to be committed:
  39.   (use "git reset HEAD ..." to unstage)

  40.         new file: LICENSE

  41. //继续编辑LICENSE文件

  42. $ git status
  43. On branch master
  44. Changes to be committed:
  45.   (use "git reset HEAD ..." to unstage)

  46.         new file: LICENSE  //这个是暂存区的文件

  47. Changes not staged for commit:
  48.   (use "git add ..." to update what will be committed)
  49.   (use "git checkout -- ..." to discard changes in working directory)

  50.         modified: LICENSE  //这个是修改区的文件



  51. $ git commit -m "add a license file"     //将暂存区的文件提交到仓库区
  52. [master 585c29e] add a license file
  53.  1 file changed, 8 insertions(+)
  54.  create mode 100644 LICENSE


  55. $ git status   //目前修改区和仓库区各有一个文件,下面有两个建议的操作
  56. On branch master
  57. Changes not staged for commit:
  58.   (use "git add ..." to update what will be committed)
  59.   (use "git checkout -- ..." to discard changes in working directory)

  60.         modified: LICENSE

  61. no changes added to commit (use "git add" and/or "git commit -a")


  62. $ git checkout -- LICENSE   //仓库区文件覆盖修改区文件,命令执行后修改区和仓库文件一致,所以work tree clean
  63. //这是有危险的命令,要谨慎使用


  64. $ git status
  65. On branch master
  66. nothing to commit, working tree clean

//再修改LICENSE文件

  1. $ git status
  2. On branch master
  3. Changes not staged for commit:
  4.   (use "git add ..." to update what will be committed)
  5.   (use "git checkout -- ..." to discard changes in working directory)

  6.         modified: LICENSE

  7. no changes added to commit (use "git add" and/or "git commit -a")


  8. $ git add LICENSE


  9. $ git status
  10. On branch master
  11. Changes to be committed:
  12.   (use "git reset HEAD ..." to unstage)

  13.         modified: LICENSE

  14. //再修改LICENSE文件

  15. $ git status
  16. On branch master
  17. Changes to be committed:
  18.   (use "git reset HEAD ..." to unstage)

  19.         modified: LICENSE

  20. Changes not staged for commit:
  21.   (use "git add ..." to update what will be committed)
  22.   (use "git checkout -- ..." to discard changes in working directory)

  23.         modified: LICENSE

  24. $



  1. $ git log
  2. commit 585c29e790e925e8ed507f89f98a2a51842841ad (HEAD -> master)
  3. Author: clz <clz@163.net>
  4. Date: Wed Oct 11 10:27:21 2017 +0900

  5.     add a license file

  6. commit 60826d5fe077448baaf3ddede55365000f88bf72
  7. Author: clongclz <clz@163.net>
  8. Date: Wed Oct 11 10:14:52 2017 +0900

  9.     add a readme file


  10. $ git add LICENSE

  11. $ git status
  12. On branch master
  13. Changes to be committed:
  14.   (use "git reset HEAD ..." to unstage)

  15.         modified: LICENSE



  16. $ git commit -m "change the license file"
  17. [master 306a5fc] change the license file
  18.  1 file changed, 1 insertion(+), 1 deletion(-)


  19. $ git log
  20. commit 306a5fc84f61e36d09e1c7c726ca125af59be856 (HEAD -> master)
  21. Author: clz <clz@163.net>
  22. Date: Wed Oct 11 11:32:59 2017 +0900

  23.     change the license file

  24. commit 585c29e790e925e8ed507f89f98a2a51842841ad
  25. Author: clz <clz@163.net>
  26. Date: Wed Oct 11 10:27:21 2017 +0900

  27.     add a license file

  28. commit 60826d5fe077448baaf3ddede55365000f88bf72
  29. Author: clz <clz@163.net>
  30. Date: Wed Oct 11 10:14:52 2017 +0900

  31.     add a readme file






阅读(1587) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~