Closed zhouzhongyuan closed 7 years ago
查看分支
git branch
创建dev分支,切换到dev分支
git checkout -b dev
git branch dev
git checkout dev
切换到master分支
git checkout master
合并dev分支
git merge dev
删除dev分支
git branch -d dev
显示最近的三条记录
git log -n 3
2.3 Git Basics - Viewing the Commit History
查看远程分支:
git branch -a
查看远程地址
git remote -v
输出:
origin git@github.com:bvaughn/react-virtualized.git (fetch)
origin git@github.com:bvaughn/react-virtualized.git (push)
clone远程分支:
git checkout -b virtualizedlist remotes/origin/virtualizedlist
添加远程地址:
git remote add origin https://github.com/zhouzhongyuan/del.git
creates a new remote called
origin
located athttps://github.com/zhouzhongyuan/del.git
. Once you do this, in your push commands, you can push toorigin
instead of typing out the whole URL.
推送到远程地址:
git push -u origin master
push the commits in the local branch named
master
to the remote namedorigin
Global .gitignore
git config --global core.excludesfile ~/.gitignore_global
第一个commit
git log --reverse
查看源代码时必备
不再bash shell中显示file lists
svn co -q URL
显示最近的三条记录
svn log -l 3
显示某个文件某两个版本的区别
svn diff -r 8979:11390 SelectViewController.m
切换用户
rm -rf ~/.subversion/auth
svn up ( it'll ask you for new username & password )
How change default SVN username and password to commit changes?
指定用户提交
svn commit -m "Add Wechat QRPay prepay" --username=zhouzy
A common mistake is cloning using the default (HTTPS) instead of SSH. You can correct this by going to your repository, clicking the ssh button left to the URL field and updating the URL of your origin remote like this
git remote set-url origin git@github.com:username/repo.git
gitignore
# ignoredist文件件下的所有内容,除了index.html
**/dist/*
!**/dist/index.html
git clone
git branch -a
git checkout
git log --oneline | wc -l
官方文档:8.1 Git 与其他系统 - Git 与 Subversion
git clone:
git update
git push
Error: git svn rebase --> "file.abs: needs update"
或者
参考How to "git svn dcommit" with uncommitted changes