Git cmd

出自 qingwei personal wiki
於 2018年1月15日 (一) 07:09 由 Yuanliu2 (對話 | 貢獻) 所做的修訂
(差異) ←上個修訂 | 最新修訂 (差異) | 下個修訂→ (差異)
前往: 導覽搜尋

[yuanliu2@crdc-sdn-ucs2 workspace]$ git clone git@sj-cable-gitlab.cisco.com:jasper/CIS.git Cloning into 'CIS'... Agent admitted failure to sign using the key. git@sj-cable-gitlab.cisco.com's password: 方法1:

重新生成SSH-key,註銷再登陸系統即可 方法2:

在終端下執行命令 ssh-add

[yuanliu2@crdc-sdn-ucs2 workspace]$ ssh-add Identity added: /home/yuanliu2/.ssh/id_rsa (/home/yuanliu2/.ssh/id_rsa) [yuanliu2@crdc-sdn-ucs2 workspace]$ git clone git@sj-cable-gitlab.cisco.com:jasper/CIS.git Cloning into 'CIS'... remote: Counting objects: 4571, done. remote: Compressing objects: 100% (14/14), done. remote: Total 4571 (delta 6), reused 0 (delta 0) Receiving objects: 100% (4571/4571), 62.16 MiB | 6.44 MiB/s, done. Resolving deltas: 100% (2261/2261), done.


$ git apply PATCH --reject $ edit edit edit--------手動merge衝突 (譯註:$ git status) $ git add FIXED_FILES $ git am --resolved

回滾 git reset –hard 8ff24a6803173208f3e606e32dfcf82db9ac84d8

git add撤銷 git reset HEAD 如果後面什麼都不跟的話 就是上一次add 裡面的全部撤銷了


[yuanliu2@crdc-sdn-ucs2 rpd-service-manager]$ git pull error: There are still logs under '.git/logs/refs/remotes/origin/bugfix/haofan' From ssh://bitbucket-eng-sjc1.cisco.com:7999/cmtsorch/rpd-service-manager

! [new branch]      bugfix/haofan -> origin/bugfix/haofan  (unable to update local ref)

[yuanliu2@crdc-sdn-ucs2 rpd-service-manager]$ rm -rf .git/logs/refs/remotes/origin/bugfix/haofan [yuanliu2@crdc-sdn-ucs2 rpd-service-manager]$ git fetch From ssh://bitbucket-eng-sjc1.cisco.com:7999/cmtsorch/rpd-service-manager

* [new branch]      bugfix/haofan -> origin/bugfix/haofan

[yuanliu2@crdc-sdn-ucs2 rpd-service-manager]$ git pull