1.创建本地仓库
2.Idear 打开引入仓库
a)把项目拷贝到仓库目录下
D:\gitrepo\jyz-eureka
b)提交本地仓库及缓存区域
Add添加完后如下
Commit提交完后 文件内容颜色发生改变
c)本地文件上传到远程私有仓库
git remote add origin <server>
远程服务器配置地址
d)如果进行远程服务器pull报下面错误
Push rejected: Push master to git/master was rejected by remote
说明权限不够重新进行远程服务器设置
[root@izey5xz git]# su git
[git@izey5xz ~]$ git init --bare /home/git/jyzrepo
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: git config --global init.defaultBranch <name>
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: git branch -m <name>
Initialized empty Git repository in /home/git/jyzrepo/
查看权限
再次push上传成功
15:15 Push successful: Pushed master to new branch git/master
3.检出仓库
执行如下命令以创建一个本地仓库的克隆版本:
git clone /path/to/repository
如果是远端服务器上的仓库,你的命令会是这个样子:
git clone username@host:/path/to/repository
打开idear
设置远程地址
即可下载远程服务器项目