码迷,mamicode.com
首页 > 其他好文 > 详细

git

时间:2019-05-18 13:47:47      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:初始   mic   复制   public   ima   file   div   ack   finger   

1、修改仓库的名字

 

2、本地和github账号创建联系

(base) localhost:~ ligaijiang$ ssh-keygen -t rsa -C"jiangpr_ok@163.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/ligaijiang/.ssh/id_rsa): 
/Users/ligaijiang/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/ligaijiang/.ssh/id_rsa.
Your public key has been saved in /Users/ligaijiang/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:Jw0OQma8s87Ij9MxYE/2VssjHCsHzkVU1uFrjLBcw2Y jiangpr_ok@163.com
The key‘s randomart image is:
+---[RSA 2048]----+
|   .+...o...     |
|   +. .o ..      |
|    .oo E .      |
|  o *ooO.* .     |
| . B Bo=S.*      |
|    O B ++       |
| . = * . .       |
|  +.+            |
|  .o.            |
+----[SHA256]-----+

 复制/Users/ligaijiang/.ssh/id_rsa.pub这个文件中的内容,打开github中右上角/settings/SSH and GPG keys/new SSH key:

技术图片

 

 

3、创建文件夹及初始化

创建文件夹,git哪个文件夹的内容呢?

(base) localhost:~ ligaijiang$ mkdir /Users/ligaijiang/git

初始化成git可以管理的仓库

(base) localhost:~ ligaijiang$ cd git
(base) localhost:git ligaijiang$ pwd
/Users/ligaijiang/git
(base) localhost:git ligaijiang$ git init
Initialized empty Git repository in /Users/ligaijiang/git/.git/

4、本地仓库和远程仓库关联

5、本地仓库内容推送到远程仓库

add:git add .

commit:git commit -m "sjw-1---2"

push:git push -u origin master

6、

git

标签:初始   mic   复制   public   ima   file   div   ack   finger   

原文地址:https://www.cnblogs.com/jpr-ok/p/10885380.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!