deepin下用命令管理自己的Github仓库

用命令链接github

初始化

需要用ssh公钥链接到github,注意不能从vim中直接复制

介绍一个命令: xsel < test.txt
将文件中内容直接复制到剪切板中

具体做法

git remote add pprp www.github.com/name

ssh-keygen -t rsa -C "111@qq.com"

xsel < /home/name/.ssh/id_rsa.pub

具体应用

添加到远程库

git remote add origin//添加远程仓库 

git@github.com:pprp/deeplearning.git

git push -u origin master

生成ssh-key:

ssh-keygen -t rsa -C "youremail@qq.com"

验证是否成功:

ssh -T git@github.com

本地更新远端修改

git fetch origin

将更新同步到本地:

git merge origin/master

新建文件以后上传

git add newfilename
git commit -m "message"
git push origin master

增加删除分支

git remote -v 查看
git remote add name git@github.com:pprp/deeplearning.git
git remote rm name

克隆库文件

git clone
git clone http://github.com/pprp/nameofrepo

可以不用add

git commit -am 'message'

查看提交历史

git log
git log --oneline 简洁版

分支操作

git branch newnameforbranch
git checkout newnameforbranch
git branch -d newnameforbranch 删除
posted @ 2018-03-24 20:32  pprp  阅读(1176)  评论(0编辑  收藏  举报