deepin下用命令管理自己的Github仓库
2024-08-25 03:48:22
用命令链接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 删除
最新文章
- MVP模式(Android)
- WebAPI学习点滴(二)
- JavaAPI_01
- 在Hadoop-2.2.0集群上安装 Hive-0.13.1 with MySQL
- 类型强转(type cast)
- HDU 5025
- 获取 CPU 序列号
- 如果将WCF服务发布为rest模式
- 小学生之Map集合框架的使用
- [置顶] 白话二分匹配之最大匹配+附上hdu2063解题报告
- iOS7适配问题
- Linux学习之修改主机名
- 「python」: arp脚本的两种方法
- ROS安装与卸载
- laravel中artisan的用法
- personalblog
- LeetCode88.合并两个有序数组
- spring 定时任务参数配置详解
- 申请apple开发人员账号的波折
- 下列哪个为JSP的隐含对象。