ubuntu githib 上传项目

来源:互联网 发布:用友软件 t系列 编辑:程序博客网 时间:2024/06/05 15:38
   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