Git
Git
一、解决版本冲突:
1、命令试
didideMacBook-Pro-42:chewu didi$ git status
On branch feature_scmpf_20180705160812
Your branch is up to date with 'origin/feature_scmpf_20180705160812'.
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: elevate/cr.yml
no changes added to commit (use "git add" and/or "git commit -a")
didideMacBook-Pro-42:chewu didi$ git add elevate/cr.yml
didideMacBook-Pro-42:chewu didi$ git status
On branch feature_scmpf_20180705160812
Your branch is up to date with 'origin/feature_scmpf_20180705160812'.
All conflicts fixed but you are still merging.
(use "git commit" to conclude merge)
Changes to be committed:
modified: elevate/cr.yml
didideMacBook-Pro-42:chewu didi$ git commit -m '修改cr.yaml'
[feature_scmpf_20180705160812 2616cf94] 修改cr.yaml
didideMacBook-Pro-42:chewu didi$ git push
Username for 'https://git.xiaojukeji.com': lixiao
2、git 放弃本地修改,强制拉取更新
git fetch --all
git reset --hard origin/master
git pull //可以省略
git fetch 指令是下载远程仓库最新内容,不做合并
git reset 指令把HEAD指向master最新版本
3、Git如何切换用户
查看用户:git config user.name
查看邮箱:git config user.email
修改用户名和邮箱的命令:
git config --global user.name "Your_username"
git config --global user.email "Your_email"
Last updated
Was this helpful?