|
|
| 第186行: |
第186行: |
| {{shc|<syntaxhighlight lang="bash"> | | {{shc|<syntaxhighlight lang="bash"> |
| git mv src/a.js src/b.js</syntaxhighlight>|$|/home/kangkk}} | | git mv src/a.js src/b.js</syntaxhighlight>|$|/home/kangkk}} |
|
| |
| == 远程仓库 ==
| |
| === 临时分支 ===
| |
| {| class="wikitable"
| |
| |-
| |
| | git remote -v || 查询当前远程的版本 || <syntaxhighlight lang="javascript">
| |
| origin git@gitee.com:b***c/ask***-pc.git (fetch)
| |
| origin git@gitee.com:b***c/ask***-pc.git (push)</syntaxhighlight>
| |
| |-
| |
| | <!-- git pull origin master --> || 直接拉取并合并最新代码( 不推荐 ) || 示例
| |
| |-
| |
| | git fetch origin master:mastertmp || 获取最新代码到本地临时分支 || 示例
| |
| |-
| |
| | git diff mastertmp || 查看本地 mastertmp 分支与当前分支的版本差异 ||
| |
| |-
| |
| | git merge mastertmp || 合并最新临时分支到本地分支 ||
| |
| |-
| |
| | git branch -D mastertmp || 删除本地临时分支 ||
| |
| |}
| |
| === 没有临时分支 ===
| |
| {| class="wikitable"
| |
| |-
| |
| | git remote -v || 查询当前远程的版本 || <syntaxhighlight lang="javascript">
| |
| origin git@gitee.com:b***c/ask***-pc.git (fetch)
| |
| origin git@gitee.com:b***c/ask***-pc.git (push)</syntaxhighlight>
| |
| |-
| |
| | git fetch origin master || 获取远端的 origin/master 分支 || 示例
| |
| |-
| |
| | git log -p master..origin/master ||查看本地 master 与远端 origin/master 的版本差异 || 示例
| |
| |-
| |
| | git merge origin/master || 合并远端分支 origin/master 到当前分支 ||
| |
| |}
| |
|
| |
|
| == 重置本地分支 == | | == 重置本地分支 == |