使用gitlab
(1)删除已有的公鑰

使用指令:ssh-keygen.exe
私鑰預設路徑:/c/users/admin/.ssh/id_rsa
執行結果:
$ ssh-keygen.exe
generating public/private rsa key pair.
enter file in which to save the key (/c/users/admin/.ssh/id_rsa):
enter passphrase (empty for no passphrase):
enter same passphrase again:
your identification has been saved in /c/users/admin/.ssh/id_rsa.
your public key has been saved in /c/users/admin/.ssh/id_rsa.pub.
the key fingerprint is:
31:87:7e:23:33:8f:70:61:c9:29:66:a4:7e:2c:db:98 admin@admin-pc
the key's randomart image is:
+--[ rsa 2048]----+
| . |
| o . + |
| . + x . |
| . + + = |
| o + s o |
| b o b . |
| e . . . |
| |
+-----------------+
生成的公私玥:
其中,id_rsa.pub 是公鑰,需要拷貝id_rsa.pub内容到github中
把上述内容拷貝到github中,如下圖
注意:内容後面不能有空格和換行.
添加成功:
這樣就可以使用git bash直接clone 代碼庫勒.
使用指令:git clone [email protected]:aaa/bb_web.git
檢視分支:
git branch -r
檢出指定分支
git checkout origin/dev_revert_online
送出修改的檔案(commit)
第一次送出時失敗
解決方法:
先執行:git config --global user.email "[email protected]"
然後就送出成功了
檢視最後一個commit了的檔案
git log -n 1
送出流程
git add index.html
git commit -m "test" *
git push
$ git checkout
your branch is up-to-date with 'origin/master-bug'.