查看远程仓库:
(pytorch) [ddy17@mjrc-server12 Speech-Transformer-plus-2DAttention]$ git remote -v
origin https://github.com/stephen-song/Speech-Transformer-plus-2DAttention.git (fetch)
origin https://github.com/stephen-song/Speech-Transformer-plus-2DAttention.git (push)
从远程获取最新版本到本地:
(pytorch) [ddy17@mjrc-server12 Speech-Transformer-plus-2DAttention]$ git fetch origin 2D-Attention:temp
remote: Enumerating objects: 13, done.
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 13 (delta 3), reused 7 (delta 3), pack-reused 0
展开对象中: 100% (13/13), 完成.
来自 https://github.com/stephen-song/Speech-Transformer-plus-2DAttention
* [新分支] 2D-Attention -> temp
6fb8497..9517c8b 2D-Attention -> origin/2D-Attention
git fetch origin 2D-Attention:temp 这句命令的意思是:从远程的origin仓库的2D-Attention分支下载到本地并新建一个分支temp
比较本地的仓库和远程参考的区别:
(pytorch) [ddy17@mjrc-server12 Speech-Transformer-plus-2DAttention]$ git diff temp
diff --git a/egs/aishell/run.sh b/egs/aishell/run.sh
index 45c3c80..8277b0e 100644
--- a/egs/aishell/run.sh
+++ b/egs/aishell/run.sh
@@ -50,12 +50,12 @@ maxlen_out=150
k=0.2
warmup_steps=4000
# save & logging
-checkpoint=1
+checkpoint=0
...
命令的意思是比较2D-Attention分支和temp分支的不同
合并temp分支到master分支:
(pytorch) [ddy17@mjrc-server12 Speech-Transformer-plus-2DAttention]$ git merge temp
更新 6fb8497..9517c8b
Fast-forward
egs/aishell/run.sh | 146 ++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------
src/solver/solver.py | 2 +-
src/transformer/attention.py | 16 +++++++----
src/transformer/decoder.py | 20 +++++++------
src/transformer/encoder.py | 22 +++++++-------
src/transformer/transformer.py | 30 ++++++++++++++++---
6 files changed, 135 insertions(+), 101 deletions(-)
如果不想要temp分支了,可以删除此分支:
git branch -d temp
如果该分支没有合并到主分支会报错,可以用以下命令强制删除git branch -D <分支名>