git删除origin_git 常用操作总结
1. 初始化
用户
$ git config --global user.email "your email" $ git config –-global user.name "your name"$ git config --global user.email "your email" $ git config –-global user.name "your name"
2. 秘钥
查看是否存在秘钥
$ ls -al ~/.ssh$ ls -al ~/.ssh
id_rsa 是私钥,id_rsa.pub 是公钥
id_rsa.pub 是你需要上传到 github 的 SSH KEY
生成秘钥
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
3. 本地库和远程库
已创建有远程库,未创建本地库
$ git clone "your repo"$ git clone "your repo"
已创建本地库,未创建远程库
1. 新建文件夹 $ mkdir test 2. 初始化 git $ git init 3. 移除原有的 origin $ git remote rm origin 4. 添加你的远程库(SSH地址) $ git remote add origin "your remote repo" 5. 更新本地库 $ git pull 6.1. 新建文件夹 $ mkdir test 2. 初始化 git $ git init 3. 移除原有的 origin $ git remote rm origin 4. 添加你的远程库(SSH地址) $ git remote add origin "your remote repo" 5. 更新本地库 $ git pull 6.