git 操作

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 文件夹的差异


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值