1. git config
git config --global user.name "xxxname"
git config --global user.email "xxx@email.com"
git config --list
mkdir repository
cd repository
git init
git status
git add xxx.file
git ci -m "xxx"
rm file
git rm file
git ci -m ""
git pull
git push
git clone https://github.com/xxx
2. git Bcompare config
add Bcompare.exe path to $PATH windows
git config --global diff.tool bc4
git config --global difftool.bc4.cmd 'BCompare.exe "$LOCAL" "$REMOTE"'
git config --global difftool.prompt false
git config --global merge.tool bc3
git config --global mergetool.bc3.cmd "\"c:/program files/beyond compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""
git config --global mergetool.bc3.trustExitCode true
3. git branch
$git checkout -b bugfix # create branch
# fix bug
$git commit -m "fix bug xxx "
$git checkout master
$git merge bugfix
$git log --graph --pretty=oneline --abbrev-commit
$git branch -d bugfix # delete branch
# if meet CONFLICT
$git status
# edit conflict files
$git add files_edited_conflict
$git commit -m "edit conflict files"
4. comapre
git difftool 可以产看当前没有add 的内容修改
查看已经add 没有commit 的改动 使用 git difftool --cached
git diff HEAD 是上面两条的合并
git diff 版本号码1 版本号码2 src : 比较两个版本号码的src 文件夹的差异