[git] github 使用简单记录
前提 :1. 已有 github 账号。2. 已安装 git 。3. 在 github 和 本地 git 客户端交互秘钥。(这步我记得需要做,有点久远,不确定。)
正文:
下面是一个简单的例子。先在 github 创建新的库,在本地拉取 github 的新库,将需要需要上传到 github 的文档放到本地库,然后通过 git 上传到 github 上面。具体步骤如下:
1. 在 github 上面创建一个库。
点击 repository 界面的 New 按钮,然后填入 Repository name 和 Description ,最后点击 Create repository 按钮即可。
创建完后,新库中自动创建了一个 README.md 文件,记录刚刚输入的名字和描述。
例子如下:
Repository name : subtitleTranslation
Description (optional) : for subtitle translation
2. 在库的页面点击 Clone or download 按钮,获取复制库的链接。
例如:
git@github.com:garrisonz/subtitleTranslation.git
3. 在本机找一个目录,通过命令 git clone 并拉取刚刚在 github 上面新建的库。
例如:
grs:github grs$ git clone git@github.com:garrisonz/subtitleTranslation.git
Cloning into 'subtitleTranslation'...
Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.
Saving password to keychain failed
Identity added: /Users/grs/.ssh/id_rsa (/Users/grs/.ssh/id_rsa)
remote: Counting objects: , done.
remote: Total (delta ), reused (delta ), pack-reused
Receiving objects: % (/), done.
Checking connectivity... done.
grs:github grs$
4. 进入拉去下来的项目,能看到从 github 库中拉去下来的拷贝
grs:github grs$ cd subtitleTranslation/
grs:subtitleTranslation grs$ ll
total
drwxr-xr-x grs staff Jul : .
drwxr-xr-x grs staff Jul : ..
drwxr-xr-x grs staff Jul : .git
-rw-r--r-- grs staff Jul : README.md
5. 将需要追踪版本的文件放置到本地库目录下。通过下面命令将文件推送到 github 上面。
git add xxx.srt // 对文件 xxx.srt 开始进行变动跟踪 git commit -m "comment mssage" // 提交变动 git push // 将变动推送到 github 库上面。
6. 其他常用命令
git status // 查看当前库的修改情况。提示信息会指引下一步做什么。可常用。 git log // 查看提交变动的记录 git diff // 查看不同
参考
1-18 step, Git Tutorial - Try git, github
Git 教程,廖雪峰的官方网站, 这个网站的介绍比较详细,之前看过一次,不过用得少,差不多都忘了。
[git] github 使用简单记录的更多相关文章
- GitHub使用简单记录
根据<GotGitHub>[1]所做的一些整理 1. 浏览托管项目 在GitHub的页面中可以使用键盘快捷键 (1)按下问号(?)会在弹出窗口显示当前页面可用的快捷键. (2)在项目的代码 ...
- linux下git+github个人使用记录
Linux: 安装git的命令: sudo apt install git 查看版本确认安装成功: git --version 生成密钥: ssh-keygen -t rsa -C "you ...
- Git 常用命令简单记录
分布式版本控制系统,跟踪文本文件的改动 ubuntu安装: sudo apt install git 安装完成后,设置使用的用户名和邮箱: 全局: git config --global user.n ...
- GitHub的简单使用记录
记录于:2013/4/24 GitHub(网址 https://github.com/)是一个面向开源及私有软件项目的托管平台,因为只支持Git作为唯一的版本库格式进行托管,故名GitHub. G ...
- git与github的简单使用教程
git与github的简单使用教程 一.创建仓库 点击new,进入创建仓库页面 对将要创建的仓库进行一些简单的设置 最后再点击create repository就可以了. 到这我们就创建好了一个仓库. ...
- git github简单知识
Git 常用命令 git init here -- 创建本地仓库(repository),将会在文件夹下创建一个 .git 文件夹,.git 文件夹里存储了所有的版本信息.标记等内容 git remo ...
- Github最简单实用的Git命令指南
create a new repository on the command line echo "# test" >> README.md git init gi ...
- 简单记录常用git 命令
声明:仅作笔记用 拉取远程代码 1.git pull 2.如果需要,输入账户名密码 将本地代码推送到远程 1.git push 2.如果需要,输入账户名密码 同步远程分支 1.git fetch 2. ...
- 利用git工具命令简单的从github上拷贝和上传代码
第一:从github上拷贝项目到本地 1.在github上建立一个项目名为:MygitTest 2.在我们本地电脑上把这个项目拷贝下来:直接选择一个文件夹,右键选择git Bash here 直接 ...
随机推荐
- Badge分析&如何逼死处女座
Badge分析 所谓Badge,原本是iOS上的一个效果,但是被Android抄的多了,也就成了Android的标配.图就不上了,大家都懂的. 应用icon显示角标实际上是在Launcher中实现的, ...
- yii2 and short_open_tag
在看yii2的时候, 在main文件里看到了这样一段代码 <?= Yii::$app->language ?> 而我查看了php.ini里的配置, short_open_tag=Of ...
- HDU 1756 Cupid's Arrow 判断点在多边形的内部
Cupid's Arrow Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tot ...
- 简易google地图api调用
代码如下: <!DOCTYPE html> <html> <head> <meta name="viewport" content=&qu ...
- 使用WMI来控制Windows目录 和windows共享机制
1.使用WMI来控制Windows目录 本文主要介绍如何使用WMI来查询目录是否存在.文件是否存在.如何建立目录.删除目录,删除文件.如何利用命令行拷贝文件,如何利用WMI拷贝文件 using Sys ...
- (转)php5中类的学习
类的结构: 类的内部能可能有三种东西,就是常量(constant),属性(property)和方法(method),功能可以理解成类外部的常量,变量和函数. 复制代码代码如下: <?ph ...
- Directory类
string[] pathes = Directory.GetDirectories(@"G:\ReawFiles");//获得所有的文件夹 string[] pathes = D ...
- 启动php-fpm报错:please specify user and group other than root
安装好PHP之后启动报错: 启动php-fpm报错:please specify user and group other than root, pool 'default 修改 php-fpm.co ...
- JavaScript--函数-01
函数的本质: function:创建一个函数对象的意思 什么是函数对象: 专门封装一个函数定义的存储空间 其实,函数是一个引用类型的对象 函数名,其实是一个引用函数对象的变量 函数只有在调用时才执行, ...
- gui线程
package thread; import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.event.Acti ...