-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
115 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# 将所有新增、修改、删除的文件提交到索引中 | ||
git add . | ||
# 将所有新增、修改的文件提交到索引中 | ||
git add --ignore-removal . | ||
# 将所有新增、修改、删除的文件提交到索引中 | ||
git add -A | ||
# 将所有修改、删除的文件提交到索引中 | ||
git add -u | ||
|
||
# 初始化当前目录为仓库 | ||
git init | ||
# 创建 <repo_name> 仓库 | ||
git init <repo_name> | ||
|
||
# 查看文件每行的最后提交人和时间 | ||
git blame <file> | ||
# 查看文件行数范围内的最后提交人和时间 | ||
git blame <file> -L <start>,<end> | ||
# 查看文件某个方法的最后提交人和时间 | ||
git blame <file> -L :<funcname> | ||
|
||
# 全局配置 git 用户名 | ||
git config --global user.name "your name" | ||
# 全局配置 git 邮箱 | ||
git config --global user.email "[email protected]" | ||
# 储存当前仓库凭证 | ||
git config credential.helper store | ||
# 全局模式储存仓库凭证 | ||
git config --global credential.helper store | ||
# 全局模式缓存凭证 15 分钟 | ||
git config --global credential.helper cache | ||
|
||
# 在本地创建远程分支 | ||
git checkout -b <local-branch-name> origin/<remote-branch-name> | ||
# 把远程分支拉到本地 | ||
git fetch origin <branch_name> | ||
# 解决拉取项目到本地新仓库 fatal: refusing to merge unrelated histories 的问题 | ||
git pull origin master --allow-unrelated-histories | ||
# 拉取远程分支到本地 | ||
git pull origin <branch-name> | ||
# 撤销所有合并操作 | ||
git merge --abort | ||
# 查看某人一段时间的提交记录,并显示详情 | ||
git log --stat --author=<pattern> --after=<date> --before=<date> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# 查看磁盘使用情况,并格式化输出 | ||
df -h | ||
# 查看第一层目录的文件夹大小,并格式化输出 | ||
du -d 1 -h | ||
# 恢复上次保存的任务状态 | ||
pm2 resurrect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# 在当前文件夹初始化 Vagrantfile | ||
vagrant init [name [url]] | ||
# 在当前文件夹初始化 centos7 | ||
vagrant init centos/7 | ||
# 启动虚拟机" | ||
vagrant up | ||
# 登陆虚拟机" | ||
vagrant ssh | ||
# 登陆虚拟机" | ||
vagrant halt | ||
# 销毁虚拟机" | ||
vagrant destroy [name|id] | ||
# 销毁虚拟机,并对询问回答 yes" | ||
vagrant destroy -f | ||
# 打包 box" | ||
vagrant package | ||
# 打包 box,并指定包名" | ||
vagrant package --ouput <box-name> | ||
# 当前虚拟机状态 | ||
vagrant status | ||
# 重新加载虚拟机配置 | ||
vagrant reload | ||
# 查看所有虚拟机状态 | ||
vagrant global-status | ||
# 查看所有 box 列表 | ||
vagrant box list | ||
# 删除 box | ||
vagrant box remove <box-name> | ||
# 删除 box,并指定版本 | ||
vagrant box remove <box-name> --box-version <version> | ||
# 更新 box 版本" | ||
vagrant box update | ||
# 更新指定 box 版本 | ||
vagrant box update --box <box-name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,16 @@ git add --ignore-removal ., 将所有新增、修改的文件提交到索引中 | |
git add -A, 将所有新增、修改、删除的文件提交到索引中 | ||
git add -u, 将所有修改、删除的文件提交到索引中 | ||
git init, 初始化当前目录为仓库 | ||
git init {repo_name}, 创建 {repo_name} 仓库 | ||
git init {repo_name}, 创建 {repo_name} 仓库 | ||
git init <repo_name>, 创建 <repo_name> 仓库 | ||
git init <repo_name>, 创建 <repo_name> 仓库 | ||
git config --global user.name "your name", 全局配置 git 用户名 | ||
git config --global user.email "[email protected]", 全局配置 git 邮箱 | ||
git config credential.helper store, 储存当前仓库凭证 | ||
git config --global credential.helper store, 全局模式储存仓库凭证 | ||
git config --global credential.helper cache, 全局模式缓存凭证 15 分钟 | ||
git fetch origin {branch_name}, 把远程分支拉到本地 | ||
git checkout -b <local-branch-name> origin/<remote-branch-name>, 在本地创建远程分支 | ||
git fetch origin <branch_name>, 把远程分支拉到本地 | ||
git pull origin master --allow-unrelated-histories, 解决拉取项目到本地新仓库 fatal: refusing to merge unrelated histories 的问题 | ||
git pull origin <branch-name>, 拉取远程分支到本地 | ||
git merge --abort, 撤销所有合并操作 | ||
git log --stat --author=<pattern> --after=<date> --before=<date>, 查看某人一段时间的提交记录,并显示详情 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
df -h, 查看磁盘使用情况,并格式化输出 | ||
du -d 1 -h, 查看第一层目录的文件夹大小,并格式化输出 | ||
pm2 resurrect, 恢复上次保存的任务状态 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters