-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git 实验 #27
Comments
@theia/clihttps://www.npmjs.com/package/@theia/cli https://npm.io/package/@theia/cli
https://theia-ide.org/docs/composing_applications/ Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript Eclipse Theia是使用TypeScript实现的云和桌面IDE框架 {
"private": true,
"dependencies": {
"@theia/callhierarchy": "next",
"@theia/file-search": "next",
"@theia/git": "next",
"@theia/markers": "next",
"@theia/messages": "next",
"@theia/mini-browser": "next",
"@theia/navigator": "next",
"@theia/outline-view": "next",
"@theia/plugin-ext-vscode": "next",
"@theia/preferences": "next",
"@theia/preview": "next",
"@theia/search-in-workspace": "next",
"@theia/terminal": "next"
},
"devDependencies": {
"@theia/cli": "next"
}
} https://github.com/eclipse-theia/theia https://github.com/eclipse-theia/theia/blob/master/dev-packages/cli/README.md |
$ git config --global user.name "xgqfrms"
$ git config --global user.email "xgqfrms@gmail.com"
```sh
$ vim .gitconfig
email = xgqfrms@ufo.com
name = xgqfrms
$ cat .gitconfig
|
error: key does not contain a section: email
https://stackoverflow.com/questions/45174228/git-error-key-does-not-contain-a-section https://www.thetopsites.net/article/52099522.shtml $ vim ~/.gitconfig
# email = xgqfrms@ufo.com
# name = xgqfrms
[user]
email = xxx@xxx.com
name = xgqfrms
$ cat ~/.gitconfig
$ git config --global --edit
# git config -g -e ??? [user] + [core]# inner local project
$ vim .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[user]
name = xgqfrms
email = xgqfrms@ufo.com
$ cat .git/config
|
git section[core] + [user] [core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[user]
name = xgqfrms
email = xgqfrms@xgqfrms.xyz |
git merge -m "" dev$ git merge -m 'merge experimental branch' experimental
|
git commit -a -m "" === git commit -a (add) + git -m "" ❌👎git commit -a -m "" === git commit -a (--all) + git -m "" ✅👍
$ git commit -a -m 'update file3 on master'
|
what's git commit -a -m meanings?git commit -a -m
$ git commit -h
usage: git commit [<options>] [--] <pathspec>...
-q, --quiet suppress summary after successful commit
-v, --verbose show diff in commit message template
Commit message options
-F, --file <file> read message from file
--author <author> override author for commit
--date <date> override date for commit
-m, --message <message>
commit message
-c, --reedit-message <commit>
reuse and edit message from specified commit
-C, --reuse-message <commit>
reuse message from specified commit
--fixup <commit> use autosquash formatted message to fixup specified commit
--squash <commit> use autosquash formatted message to squash specified commit
--reset-author the commit is authored by me now (used with -C/-c/--amend)
-s, --signoff add Signed-off-by:
-t, --template <file>
use specified template file
-e, --edit force edit of commit
--cleanup <mode> how to strip spaces and #comments from message
--status include status in commit message template
-S, --gpg-sign[=<key-id>]
GPG sign commit
Commit contents options
-a, --all commit all changed files
-i, --include add specified files to index for commit
--interactive interactively add files
-p, --patch interactively add changes
-o, --only commit only specified files
-n, --no-verify bypass pre-commit and commit-msg hooks
--dry-run show what would be committed
--short show status concisely
--branch show branch information
--ahead-behind compute full ahead/behind values
--porcelain machine-readable output
--long show status in long format (default)
-z, --null terminate entries with NUL
--amend amend previous commit
--no-post-rewrite bypass post-rewrite hook
-u, --untracked-files[=<mode>]
show untracked files, optional modes: all, normal, no. (Default: all)
|
git 删除分支$ git branch -d experimental
$ git branch –D test
git branch -d 只能删除那些已经被当前分支的合并的分支. |
撤销一个合并$ git reset --hard HEAD^
|
快速向前合并 但是,如果当前的分支和另一个分支没有内容上的差异,就是说当前分支的每一个提交(commit)都已经存在另一个分支里了,Git 就会执行一个 快速向前(fast forward)操作;Git 不创建任何新的提交(commit),只是将当前分支指向合并进来的分支。 |
reset 撤销$ git reset --hard HEAD^
|
log$ git log
$ git log --stat
格式化日志输出$ git log --pretty=oneline
$ git log --pretty=short
$ git log --pretty=medium
$ git log --pretty=full
$ git log --pretty=fuller
$ git log --pretty=email
$ git log --pretty=raw
也可用 medium,full,fuller,email 或 raw 格式; 可视化--graph 选项可以可视化你的提交图(commit graph) $ git log --graph --pretty=oneline
|
日志排序日志记录可以按不同的顺序来显示。如果你要指定一个特定的顺序,可以为 git log 命令添加顺序参数。 按默认情况,提交会按逆时间顺序显示,可以指定 --topo-order 参数,让提交按拓扑顺序来显示(就是子提交在它们的父提交前显示): $ git log --pretty=format:'%h : %s' --topo-order --graph
你也可以用 --reverse 参数来逆向显示所有提交日志。 |
基本命令: git config:配置相关信息 |
must config before commit$ git config --global user.email "you@example.com"
$ git config --global user.name "Your Name"
|
$ git diff
$ git diff master test
|
# 进入到临时目录
$ cd /tmp
# 克隆git仓库
$ git clone /home/shiyanlou/gitproject myrepo
$ ls -l myrepo
$ cd /tmp/myrepo
# 添加新的文件newfile
$ echo "newcontent" > newfile
# 提交修改
$ git add newfile
$ git commit -m "add newfile"
$ cd /home/shiyanlou/gitproject
$ git pull /tmp/myrepo master
|
vscode terminal show git branch |
git 实验
https://www.lanqiao.cn/courses/4/learning/
http://gitbook.liuhui998.com/
https://github.com/liuhui998/gitbook
The text was updated successfully, but these errors were encountered: