2010年9月3日 星期五

Git常用命令

快捷命令设置


1.git config --global alias.st status
2.git config --global alias.ci commit
3.git config --global alias.co checkout
4.git config --global alias.br branch
5.git config --global alias.dc dcommit
6.git config --global alias.rb rebase

彩色交互界面


1.git config --global color.branch auto
2.git config --global color.diff auto
3.git config --global color.interactive auto
4.git config --global color.status auto

设置用户信息


1.git config --global user.name "jianingy"
2.git config --global user.email "detrox@gmail.com"

克隆新项目 pre(brush:bash). git clone git://gitorious.org/bamboo/mainline.git bamboo

设置远程仓库


1.# 添加(origin 为一个标示,可以随意更换)
2.git remote add origin git@gitorious.org:bamboo/mainline.git
3.# 删除
4.git remote remove origin

操作远程仓库


1.# 提交本地修改(将本地修改提交到远程的master分支
2.git push origin master
3.# 合并远程修改(将远程的master分支合并进来
4.git pull origin master
5.# 删除远程仓库里的分枝
6.git push :branch

基本操作


01.# 提交修改
02.git add /path/to/file
03.git commit -m reason
04.# 提交全部修改
05.git commit -a -m reason
06.# 创建本地分枝
07.git co -b branch_name
08.# 查看分枝
09.git branch
10.# 删除分枝
11.git branch -D branch_name
12.# 查看分支之间的差异
13.git diff master branch
14.# 查看最新版本和上一个版本的差异(一个^表示向前推进一个版本)
15.git diff HEAD HEAD^
16.# 查看状态
17.git status
18.# 合并分支
19.git pull . branch
20.# 销毁自己的修改
21.git reset --hard

与svn互操作

 

1.# 从subversion仓库中克隆
3.# 将本地修改提交到subversion仓库
4.git svn dcommit
5.# 导入新的subversion更新

How to use simple speedtest in RaspberryPi CLI

  pi@ChunchaiRPI2:/tmp $  wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py --2023-06-26 10:4...