![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
git
zhanghuanhuanzhh
这个作者很懒,什么都没留下…
展开
-
git-8_Merge conflict resolve
test@etos20:[~/ers]((no branch))$merge conflict result enter no branch$git mergetool # run this command in VNC for merge conflict$git rebase –continue #after problem resolved$git rebase –skip ...原创 2019-03-21 17:15:25 · 403 阅读 · 0 评论 -
git-21_查看谁修改了code
git blame -L 160,+10 lhpackage.sh //Line 160 ~170原创 2019-03-22 15:10:27 · 182 阅读 · 0 评论 -
git-22_config git with colour
git config --global color.ui true原创 2019-03-22 15:11:10 · 114 阅读 · 0 评论 -
git-23_pull failed
Can not pull: You have unstaged changestestgit@VM8:[~/ers](master)$ git pull --rebase Cannot pull with rebase: You have unstaged changes. Please commit or stash them.Reason: Some files have been ...原创 2019-03-22 15:15:17 · 296 阅读 · 0 评论 -
git-24_push error
When do push, there is following error:lving deltas: 100% (3/3)remote: Processing changes: refs: 1, done remote: remote: ERROR: In commit b3f23e56cb21a5fb58a8c47dd6d68566a5b6f849remote: ERROR: co...原创 2019-03-22 15:16:53 · 338 阅读 · 0 评论 -
git-1_远程仓库相关命令
检出仓库: $ git clone git://github.com/jquery/jquery.git查看远程仓库:$ git remote -v查看远程仓库信息: git remote show [remote-name] //git remote show origin(origin is alias name of the URL)删除本地库中已经不存在的分支: `$...原创 2019-03-19 13:36:46 · 298 阅读 · 0 评论 -
git-2_branch操作相关命令
查看本地分支:$ git branch查看远程分支:$ git branch -r创建本地分支:$ git branch [name] ----注意新分支创建后不会自动切换为当前分支切换分支:$ git checkout [name]创建新分支并立即切换到新分支:$ git checkout -b [name]删除分支:$ git branch -d [name] ---- -d选项只能...原创 2019-03-19 13:38:04 · 119 阅读 · 0 评论 -
git-3_版本(tag)相关命令
查看版本:$ git tag创建版本:$ git tag [name]删除版本:$ git tag -d [name]创建远程版本(本地版本push到远程):$ git push origin [name]删除远程版本:$ git push origin :refs/tags/[name]合并远程仓库的tag到本地:$ git pull origin --tags上传本地tag到远程仓...原创 2019-03-19 13:39:19 · 149 阅读 · 0 评论 -
git-4_新建repo并添加到远程server
testgit@linux-0m25:[/local/workspace/testgit]$ mkdir testGittestgit@linux-0m25:[/local/workspace/testgit]$ cd testGit/testgit@linux-0m25:[/local/workspace/testgit/testGit]$ vi a.ctestgit@linux-0m25...原创 2019-03-19 13:43:23 · 663 阅读 · 0 评论 -
git-5_Git 环境建立(environment setup)
$git –version #check if the git is installed$git clone ssh://gerrit.ericsson.se:29418/ers/ers #create repo$cd ers$git checkout –b master remotes/origin/master or #create one branch$git branch -t m...原创 2019-03-19 13:45:02 · 217 阅读 · 0 评论 -
git-6_修改后提交(commit&change)
$git status #Check what's changed currently$git add $file #Add changed files to local git stage$git commit $file #Commit files, Input comments$git commit –a #commit all files not git-ad...原创 2019-03-19 13:47:27 · 853 阅读 · 0 评论 -
git-20_It's NOT the last commit that has been rejected
This case is a little trickier, but far from impossible! The story here is that you've been doing quite a bit of work, and it's spread on a couple of different commits. The task is finished and the wo...原创 2019-03-22 15:09:17 · 136 阅读 · 0 评论 -
git-19_Push with topic
Recent versions of Jenkins has a functionality to trigger specific tests based on "push-for-review" action and "topic". As example, you can push your code for review, but you want to trigger only clou...原创 2019-03-22 15:05:09 · 1331 阅读 · 0 评论 -
git-18_squash commit
-- WARNING: It is possible to loose local commits -> if there are local commits present then do this procedure in a local branch , so that if you need to you can just delete your branch and try aga...原创 2019-03-22 15:04:20 · 412 阅读 · 0 评论 -
git-8_Push to Gerrit for review
$git push origin HEAD:refs/for/mastermodify review comments$git commit --amend #After you did some changes, commit using this command.Hook will update the change-id same with previous commit$git p...原创 2019-03-21 17:16:44 · 237 阅读 · 0 评论 -
git-9_delete branch
git branch -d <branch> #delete the branch <branch>; if the branch have a commit not push to remote, this command will fail with a warning.git branch -D <branch> #delete branch...原创 2019-03-21 17:24:56 · 159 阅读 · 0 评论 -
git-10_do tag
$git tag -a tag_test 1a85321 #tag one specific head $git tag -l #show all tags $git push origin tag_test #push tag to remote $git tag -d tag_test ...原创 2019-03-21 17:28:20 · 106 阅读 · 0 评论 -
git-11_clean workspace
Scenario: after compile, the workspace has some private files. We don’t need these files, and want to go back to the environment when we first clone the repo.$git clean -dfx # clean all files that a...原创 2019-03-21 17:34:35 · 233 阅读 · 0 评论 -
git-12_check repo URL
git remote -v原创 2019-03-21 17:36:10 · 193 阅读 · 0 评论 -
git-13_reset last commit
Reset command note:Reset 命令有3种方式:1) git reset –mixed #默认方式,不带任何参数的git reset 即为这种方式, 他回退到某个版本,只保留源码,回退comit和index信息。2) git reset –soft #回退到某个版本,只回退了commit的信息,不会恢复到index file一级。如果还要提交,直接commit即可。3) ...原创 2019-03-21 17:38:31 · 261 阅读 · 0 评论 -
git-14_Revert the HEAD
$git revert HEAD #回退到上一次提交的状态,按照某次的commit完全方向的进行一次commit$git revert HEAD^ #撤销前前一次commit$git revert commit 123434 #撤销指定的版本,撤销也会作为一次提交进行保存Note:reset 和revert的区别:revert也会作为一次提交进行保存.多了一次commit...原创 2019-03-21 17:41:52 · 152 阅读 · 0 评论 -
git-15_分支之间merge
First merge to private branch$git fetch –a #first get all latest config in repository$git branch –t core_llv origin/core_llv #create local branch $git checkout core_llv$git merge origin/master ...原创 2019-03-22 14:56:22 · 260 阅读 · 0 评论 -
git-16_local repository
Share a local repository$ cd comsa-source$ git init --shared=0771Make sure you have a branch that other developers can push to.Use a shared local repository• Example: development in mr27359 and ...原创 2019-03-22 15:00:05 · 149 阅读 · 0 评论 -
git-17_查看要push的内容
testgit@embedded-cba-1:[/local/workspace/testgit/coremw/src/clmon](develop)$ git log --stat -1commit 9b203e343b8b0dba57f486335bca832b46aaf9eaAuthor: Allen Zhao Y <allen.y.zhao@ericsson.com>Da...原创 2019-03-22 15:02:03 · 3653 阅读 · 0 评论 -
git-7_merge remote change
$git fetch #get remote repo change,local branch head will not change$git fetch –a #get all HEAD/Tag/Branch change from remote repo$git merge remotes/origin/build_llv #merge remote change ...原创 2019-03-21 17:12:34 · 513 阅读 · 0 评论