[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 直接 ...
随机推荐
- dispatch的几种队列
dispatch的几种队列 dispatch队列的生成可以有这几种方式: 1. dispatch_queue_t queue = dispatch_queue_create("com.d ...
- html02表格的使用
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- tomcat常用命令
关闭./shutdown.sh 查看Tomcat是否以关闭 ps -ef|grep java *如果你想直接干掉Tomcat,你可以使用kill命令,直接杀死Tomcat进程 kill -9 7010 ...
- Android Service生命周期及用法
Service概念及用途:Android中的服务,它与Activity不同,它是不能与用户交互的,不能自己启动的,运行在后台的程序,如果我们退出应用时,Service进程并没有结束,它仍然在后台运行, ...
- 安装php时,make步骤报错make: *** [ext/gd/gd.lo] Error 1
安装PHP时,make步骤报错make: *** [ext/gd/gd.lo] Error 1 /usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/ ...
- iOS开发 UITableView之cell
1.cell简介 UITableView的每一行都是一个UITableViewCell,通过dataSource的tableView:cellForRowAtIndexPath:方法来初始化每一行 U ...
- Swift - 26 - 函数的基础写法
//: Playground - noun: a place where people can play import UIKit // 无参无返回 // -> Void可以省略不写, 或者写成 ...
- 监听器启动顺序和java常见注解
- javascript 原生 cookie 处理
来自网络! function getCookie(name) { var start = document.cookie.indexOf(name + "="); var len ...
- 用tbody代替div 解决 table tr的隐藏问题
有如下需求,需要控制一个table内几个tr的显示问题.一开始想的方法是在这几个要显示的tr外面套一个div,利用div的display:none属性来解决. 但是后来发现div和tr嵌套的时候会有问 ...