phpstorm链接远程项目php
https://github.com/AngleQi/Mui.git
在github上建立仓库后 复制仓库地址 好比
VCS——Checkout from Version Contrl——Git中 粘贴仓库url地址
会从github仓库中拷贝一份项目 而后就能够在本地直接进行git操做
而且能够push到github仓库中 (会提示你输入github的仓库和密码)
查看远程仓库:git remotegit
查看仓库地址:git remote -vgithub
命令:vim
git remote remove <远程库名>
示例:bash
git remote remove origin
git remote add origin https://git.oschina.net/xiaoshusheng/Slow-download-speed.git
远程仓库名通常为origin,但不强制使用,能够更改成其它的服务器
git remote rename <旧名称> <新名称>
地址:http://git.oschina.net/ssh
git remote add origin https://git.oschina.net/xiaoshusheng/Slow-download-speed.git
ssh-keygen -t rsa -C "youremail@example.com"
把邮件地址换成你本身的邮件地址,一直回车,不用输入密码;完成后,能够在用户主目录里找到.ssh目录,内有id_rsa和id_rsa.pub两个文件, id_rsa是私钥,id_rsa.pub是公钥 vim ~/.ssh/id_rsa.pub。phpstorm
用编辑器打开id_ras.pub,复制公钥内容,登录http://git.oschina.net,找到对应的项目,填入公钥并保存,以下图:编辑器
用ssh下载远程项目ui
git clone git@code.aliyun.com:jingcai/backend.git
git push origin master
出错版本过低
若是要推送其余分支,好比dev,就改为:
git push origin dev
语句: git push origin master
错误 error: 没法推送一些引用到 'https://gitee.com/clayer/chat.git' 提示:更新被拒绝,由于远程仓库包含您本地尚不存在的提交。这一般是由于另外 提示:一个仓库已向该引用进行了推送。再次推送前,您可能须要先整合远程变动 提示:(如 'git pull ...')。
解决办法
先执行 git pull origin master
错误
fatal: 拒绝合并没有关的历史
[root@localhost chater]# git pull origin master --allow-unrelated-histories
解决办法
git pull origin master --allow-unrelated-histories
若是git pull提示“no tracking information”,则说明本地分支和远程分支的连接关系没有建立,用命令
git branch --set-upstream branch-name origin/branch-name。
git pull origin master
git clone https://git.oschina.net/xiaoshusheng/Slow-download-speed.git