Git
-
$ git init
- Initialized empty Git repository
-
$ ls -al
- to see git
-
$ touch file01.txt
- Init a empty file01.txt file
-
$ git status
- To see modifiyed status
-
$ git add .
- remove all modifyed files to index from workspace
- $ git add file.txt(FILENAME) : remove single modifyed file to index from workspace
-
$ git commit -m “Your annotation”
- commit index file to repository
-
$ git log [option]
- check commit versions
- options
- –all : present all branches
- –pretty=oneline : present commit info in one line
- –abbrev-commit : shorten output commit
- –graph : present in graph type
- $ git-log : easy check cmd , effect equal to add parameters
-
alias YOURALIAS=‘REALCOMMND’
- in .bashrc ,bash souse file
-
$ clear
- clear : cls
-
$ git reset --hard versionNumber
- how to get version number : ^c = double click , ^v = click mouse scroll wheel
- if back to last version ,you can also use previous version number to restore local version
-
$ git reflog文章来源:https://www.toymoban.com/news/detail-426471.html
- you can use this cmd to trace records of ops , then you can get previous version number
-
.gitignore文章来源地址https://www.toymoban.com/news/detail-426471.html
- file name is fixed
- we can choose files that we don’t want to sumbit to Git tool and describe them in .gitignore file
到了这里,关于一起来了解Git的基础知识叭~~的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!