mac idea 注册服务器,mac idea配置使用git

1、mac安装

查看git

git --version

默认有安装

2、配置(命令行操作服务器)

mac创建本地创建本地ssh-key,远程代码库服务器地址:192.168.2.10

ssh-keygen -t rsa

Generating public/private rsa key pair.

Enter file in which to save the key (/Users/tangscott/.ssh/id_rsa):

/Users/tangscott/.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/tangscott/.ssh/id_rsa.

Your public key has been saved in /Users/tangscott/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:Dw+4NhdJK5eWi3MAdbIzoiqnG9sBrs+PmXTFqzeTI14 tangscott@tangscottdeMacBook-Air.local

The key's randomart image is:

+---[RSA 2048]----+

| o . |

| . + |

| o + . |

| . + = = |

|. . * S |

|.o . O B |

|+.+ . E.+ o |

|oO *.+*= |

|=oBo+o + |

+----[SHA256]-----+

上传密钥文件 id_rsa.pub到代码服务器

cat /Users/tangscott/.ssh/id_rsa.pub | ssh git@192.168.2.10 "cat >> ~/.ssh/authorized_keys"

如果服务器/home/git/.ssh/authorized_keys不存在,在服务器上使用

ssh-keygen -t rsa 运行,一直回车即可

添加全局变量(暂时不用)

$ git config –-global user.name ‘yourName’

$ git config –-global user.email ’yourEmail@yourEmail.com‘

客户端命令行输入:git clone git@192.168.2.10:/usr/local/javasoft/gitrepos/flysky.git

git clone git@192.168.2.10:/usr/local/javasoft/gitrepos/flysky.git

Cloning into 'flysky'...

git@192.168.2.10's password:

warning: You appear to have cloned an empty repository.

3、idea配置,操作git

bdc555c9f9e996418af3f128b3fab9c1.png

ebfb038adaf5159e35d25b3a13417ac0.png

项目提交

本地仓库,在弹框选择要提交的项目,点击ok

c4b5e22f613dd92309cb5e230ac26f8c.png

fb3b5196b10e55635c5e57120725a0b2.png

在git服务器上创建一个同名项目

cd /usr/local/javasoft/gitrepos

初始化一个仓库名称为flysky

git init --bare flysky-parent.git

项目名称右键,选择git-->add;再项目名称右键,选择git-->commit

选择 git-->add 文件进入暂存区,选择 git-->commit 文件进入版本库

2cdab252e17b5d024eaf1e4a662151f1.png

a0c95aeb7800ca4e32a3818c6f930405.png

在弹框,点击“define remote”,输入git服务器地址,点击push即可

git@192.168.2.10:/usr/local/javasoft/gitrepos/flysky-parent.git

df3369dab445edcfb64b2ad330434bf5.png

从服务器上面clone

f07274a476143099971e3cca3a2b562d.png

最后在192.168.2.10:/usr/local/javasoft/gitrepos/flysky-parent.git目录里面没有找到工程的相关文件。。。。。。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值