git 一些命令

git 第一次提交报错
error: failed to push some refs to ‘git@gitlab.hegdev.com:root/heg-site-pc.git

修改当前的 project
git config user.name “myname”

修改全局
git config –global user.name “Jesse”
git config –global user.email “dfdf@sdf.com”

本地分支推送到远程

git push origin feature-branch:feature-branch

设置分支 upstream

git branch –set-upstream-to=upstream/master master

设置 push upstream

git push –set-upstream origin some-branch or git push -u origin some-branch

git fetch origin master
git log -p master origin/master
git merge origin/master

拉取单个分支并用别名

git fetch origin master:tmp
git diff tmp
git merge tmp

Leave a Reply

Your email address will not be published. Required fields are marked *