您的位置:首页 > 编程语言

ubuntu githib 上传项目

2017-12-17 17:59 148 查看
Ubuntu githib 上传项目


一.安装githib

sudo apt-get install git git-core git-gui git-doc git-svn git-cvs gitweb gitk git-email git-daemon-run git-el git-arch

二.安装ssh keys

cd ~/.ssh

ssh-keygen -t rsa -C “你自己的github对应的邮箱地址”

文件名:id_rsa(私钥) 同时公钥id_rsa.pub 一起被创建

在GitHub中,依次点击Settings -> SSH Keys -> Add SSH Key,将id_rsa.pub文件中的字符串复制进去,注意字符串中没有换行和空格。

ssh -T git@github.com 查看是否连接成功

三.开始使用

配置git:

git config –global user.name “你的github用户名”

git config –global user.email “你的github邮箱地址”

上传项目:

进入项目目录 cd xxx(xxx为你想上传的项目目录)

git init

git commit -m + “yourproject”

Push:git remote add origin https://github.com/你的github用户名/你的github仓库.git

如果:fatal: 远程 origin 已经存在。

git remote rm origin

输入用户名和密码即可

git push origin master
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ubuntu github ssh