github仓库命令行下的使用-ubuntu系统
来源:互联网 发布:怎么成为java高级编程 编辑:程序博客网 时间:2024/05/23 13:03
在ubuntu系统命令行下如何对自己的github仓库进行下载和上传呢?
1·首先检查电脑是否通过github仓库的sshkey认证
ssh -T git@github.com
如果出现:Hi xxxx! You've successfully authenticated, but GitHub does not provide shell access.
没问题,进行下一步,但是如果你没有添加过这台主机的sshkey,就会出现:
Warning: Permanently added 'github.com,1' (RSA) to the list of known hosts.Permission denied (publickey).
这是时候首先:
ssh-keygen -t rsa 然后一路回车cat ~/.ssh/id_rsa.pub复制里面的内容,如果你是在服务器上跑的话,建议用mobaxterm的编辑器把文本打开复制其中的内容
然后进入自己的github仓库的设置:
把复制的内容加到key里面去就行。
然后再次在本机运行ssh -T git@github.com
即可成功
2·通过认证能够连接github之后首先下载云端的数据库:
复制自己仓库这里的链接,假如是git@github.com/video-caffe.git
运行git clone git@github.com/video-caffe.git这时候就会开始下载仓库到本地,文件在当前目录下自动生成文件夹名为video-caffe
然后你进入video-caffe文件夹
git init #这个命令会在当前目录下创建一个.git文件夹。 git add . #这个命令会把当前路径下的所有文件,添加到待上传的文件列表中。 git commit -m "xxxxx" git remote add origin git@github.com:xuhongxin/deom.git git pull origin master #下载所有git push -u origin master #上传所有
但是一般第一次执行的时候还会提示错误
*** Please tell me who you are.Run git config --global user.email "you@example.com" git config --global user.name "Your Name"to set your account's default identity.Omit --global to set the identity only in this repository.
这时候按照提示输入
git config --global user.email "1234@qq.com"#你自己的注册github邮箱git config --global user.name "Your Name" #名字随便写,如果是开源项目,名字最好实名
其实是ubuntu下的话,可以将上面的文件分别写成upload.sh和download.sh
upload.sh:
#!/usr/bin shgit init #这个命令会在当前目录下创建一个.git文件夹。 git add . #这个命令会把当前路径下的所有文件,添加到待上传的文件列表中。 git commit -m "xxxxx" #git remote add origin git@github.com:xuhongxin/deom.git #git pull origin master #下载所有git push -u origin master #上传所有
download.sh:
#!/usr/bin shgit init #这个命令会在当前目录下创建一个.git文件夹。 git add . #这个命令会把当前路径下的所有文件,添加到待上传的文件列表中。 git commit -m "xxxxx" #git remote add origin git@github.com:xuhongxin/deom.git git pull origin master #下载所有#git push -u origin master #上传所有
下次上传的时候直接 sh upload.sh就可以了,不过注意的是这样你的github仓库上还会出现多余的upload.sh和download.sh文件
1 0
- github仓库命令行下的使用-ubuntu系统
- Ubuntu 系统下使用 git 命令行交互 github
- ubuntu系统使用github上传文件到仓库
- mac系统下git使用笔记,仓库选用github
- Ubuntu下GitHub的使用
- Ubuntu下GitHub的使用
- Ubuntu 16.04 下使用git 命令行上传到github
- MAC下使用GitHub建立属于自己的代码仓库
- github的命令行使用
- linux命令行下使用github
- 【Git/Github学习笔记】ubuntu系统下使用git命令与windows下的差别
- ubuntu下github的使用与管理
- Ubuntu下github的配置和使用
- windows7下使用Git管理gitHub仓库
- 三种直接在命令行创建GitHub仓库的形式
- ubuntu下使用git, github
- 在ubuntu下使用github
- ubuntu svn命令行下使用
- Android连接服务器相关问题
- SPOJ-COLONY - Linearian Colony!简单二分思想
- Java线程常见概念——基本概念、可见性、同步
- oracle9i客服端连接服务器
- 29. Divide Two Integers
- github仓库命令行下的使用-ubuntu系统
- Android 运行时权限高阶--封装(听课笔记)
- android 滑动冲突问题
- Android 类似手机接收到短信桌面图标改变
- python列表去重的两种方法
- Java线程
- DIV如何JS调用广告!!!
- 2016总结及2017计划
- The connection to adb is down, and a severe error has occured