常用命令
工作中检查使用的命令
SSH
$ ssh-keygen -t rsa -C "youremail@yourcompany.com"
$ ssh -T git@github.com // github连接测试(不是都是这样测试)
Git
Pro Git: Git文档
// 配置账号信息
$ git config --global user.name "name"
$ git config --global user.email email@example.com
// 常规命令
$ git init
$ git status
$ git add -A
$ git commit -m "Initial commit."
$ git clone [url]
$ git log -n // 打印LOG, n表示最近的次数
$ git branch -a // 获取所有分支列表
$ git remote -v // 查看远程库信息
$ git branch new-branch // 拉新分支
$ git branch -d [branch](master|develop)
$ git branch -D [branch](master|develop)
$ git checkout [branch](master|develop)
$ git checkout -b develop origin/develop // clone远程develop分支到本地创建的develop分支
$ git reset --hard origin/[branch](master|develop) // 同步到服务器master分支的版本
$ git remote add [shortname] [url] // 关联多个远程分支
$ git remote set-url --add origin [url] // 添加一个远程分支
$ git remote add origin [url]
$ git remote add oschina [url]
$ git push origin [branch](master|develop|feature|hotfix|release)
$ git pull origin [branch](master|develop|feature|hotfix|release)
// 打TAG
$ git tag -a v1.0.1 -m "version 1.0.1 release" 3628164 // 给3628164...打TAG
$ git push origin --tags // 推送本地全部TAG到远程
// 子模块命令
$ git submodule add [url] // 增加子模块
$ git submodule init // 下载子模块代码
$ git submodule update // 下载子模块代码
$ git clone --recursive [url] // 下载子模块代码
Shell
$ date // 查看系统时间
$ cat /etc/redhat-release // 查看centos系统版本
$ rm -rf [dir] /// 递归删除文件夹
$ scp [source] root@10.16.3.12:[dest] // 远程拷贝文件
$ scp -rf [source] root@10.16.3.12:[dest] // 远程拷贝文件夹
$ yum -y install lrzsz // 安装xshell和windowns拷贝文件命令