Meet Github
Source: http://www.liaoxuefeng.com/
Here only the local part.
Install on windows
- download: https://git-for-windows.github.io, mirror available;
- run 'Git Bash';
# Set name and email.
$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
Establish repository
# Making an empty directory
$ mkdir learngit
$ cd learngit
# display current working directory
$ pwd
# Making the current directory a Git-managed one. Don't change the directory
# .git (version repository)
$ git init
Initialized empty Git repository in /Users/michael/learngit/.git/
$ ls -ah # list hide folders
Add files into the repository
# Add files into current working directory
$ git add readme.txt
# Add annotations of this submission
$ git commit -m "wrote a readme file"
# Submit multiple files at one time
# Actually, *add* operation is to submit the file to *stage* (working area,
# store the files currently worked on) in the repository (/.git), and
# *commit* will move the ones from *stage* to current branch (git will
# automatically create one named *master* for us (*HEAD* is a pointer
# pointing to master).
$ git add file2.txt file3.txt
$ git commit -m "add 3 files."
# Check the differences between the most recent file in the repository and
# the one in stage.
$ git diff HEAD -- readme.txt
Change the files in the repository
# Check current status of the file
$ git status readme.txt
# Check the changes
$ git diff readme.txt
# If the changes agreed
$ git add readme.txt
$ git commit -m "One change"
Version swap
# Check history changes, note that a more clear time line could be seen in GUI
$ git log
$ git log --pretty=oneline
# Swap back to the last version, HEAD^^ denotes the penultimate version, and
# HEAD~100 denotes the last 100th version
$ git reset --hard HEAD^
# Recover recent versions
# If the command window is not closed after swapping back, the newer version
# could be recovered using the commit ID (first few numbers are enough; you
# could look up to it at the log checked before)
$ git reset --hard 3628164
# If the command window has been closed after swapping back, the command below
# could trace command history, thus you could find the commit ID of the newer
# file.
$ git reflog
# Back to the version for most recent *add* or *commit*
$ git checkout -- test.m
# Fetch the file most recently submitted to *master* to *stage*, then repeat
# line above.
$ git reset HEAD test.m
Deletion
# Delete the file directly in the working area
$ rm test.m
# Current status: but the file is not removed from repository
$ git status
# Delete the file from repository
$ git rm test.txt
$ git commit -m "Confirm deletion"
# Or cancel the deletion
$ git checkout -- test.txt
Meet Github的更多相关文章
- 搜刮一些开源项目的APP
iOS完整App资源收集 <iOS完整app资源收集> <GitHub 上有哪些完整的 iOS-App 源码值得参考?> <GitHub 上有哪些完整的 iOS-App ...
- 【原】Github系列之二:开源 一行代码实现多形式多动画的推送小红点WZLBadge(iOS)
更新日志 V1.2 2015.09.25 1.UITabBarItem badge is supproted; 2.Enable change badge properties when badge ...
- Useful for Android the development engineer from Github
Original:http://sysmagazine.com/posts/216591/ Many plowing on open space Github, I found assemblage ...
- 【个人经历】记自己的第一次GitHub开源代码共享经历
题记: 自己做程序员快三年有余了,感觉自己和刚入职相比确实有了不少进步,当然三年要是不进步那不就傻了吗,有时候我也在想,我在这三年里留下了什么,当然也不是说有多么高尚的想法,就是以后对别人介绍自己的时 ...
- 【RS】AutoRec: Autoencoders Meet Collaborative Filtering - AutoRec:当自编码器遇上协同过滤
[论文标题]AutoRec: Autoencoders Meet Collaborative Filtering (WWW'15) [论文作者]Suvash Sedhain †∗ , Aditya K ...
- [转帖]如何获得一个RAC Oracle数据库(从Github - oracle/docker-images) - 本地版 ---暂时未做实验.
如何获得一个RAC Oracle数据库(从Github - oracle/docker-images) - 本地版 2019-11-09 16:35:30 dingdingfish 阅读数 32更多 ...
- Openfire Meetings插件是一个包含各种Jitsi项目(如VideoBridge和Meet)的实现
Openfire Meetings插件是一个包含各种Jitsi项目(如VideoBridge和Meet)的实现.要创建与Openfire Meetings一起使用的本机客户端,建议使用Jitsi项目提 ...
- Github熟悉一
Code/代码 Commits/提交 Issues/问题 Packages/包装 Marketplace/市场 Topics/话题 Wikis/维基百科 Users/用户 Pull requests/ ...
- GitHub 热点速览 Vol.12:不可思议的浏览器 browser-2020 周涨 star 超 3 千
作者:HelloGitHub-小鱼干 摘要:本周的 GitHub Trending 像极最近的天气,温暖如春突然来个急降温.新晋 GitHub 项目重启屈指可数的模式,好在老项目们表现甚好.比如一周就 ...
随机推荐
- android Gui系统之SurfaceFlinger(1)---SurfaceFlinger概论
GUI 是任何系统都很重要的一块. android GUI大体分为4大块. 1)SurfaceFlinger 2)WMS 3)View机制 4)InputMethod 这块内容非常之多,但是理解后,可 ...
- vs.net git版本仓库使用 之解决冲突方法 原创
vs.net git 之解决冲突方法 如果别人已经修改推送到服务器,但自已本地未进行同部更新,那么就会出现要解决冲突的提示! 具体解决方法为: ... ... 下载word离线版:vs.net_git ...
- jQuery加载一个html页面到指定的div里
一.jQuery加载一个html页面到指定的div里 把a.html里面的某一部份的内容加载到b.html的一个div里.比如:加载a.html里面的<div id=“row"> ...
- Web端即时通讯技术原理详解
前言 有关IM(InstantMessaging)聊天应用(如:微信,QQ).消息推送技术(如:现今移动端APP标配的消息推送模块)等即时通讯应用场景下,大多数都是桌面应用程序或者native应用较为 ...
- 面试题整理:SQL(一)
1.横纵表转换 A表 Name Course Grade Alex English 80 Alex Chinese 70 Alex Japanese 85 Bob English 75 Bob Chi ...
- tar包在linux下 java安装
总的原则:将jdk-7u10-linux-x64.tar.gz压缩包解压至/usr/lib/jdk,设置jdk环境变量并将其修改为系统默认的jdk 1.将jdk-7u5-linux-x64.tar.g ...
- Git的常用操作,记录下
首先生成密钥 ssh-keygen -t rsa -C "your_email@youremail.com" 然后打开workdir,敲 git init 设置一个远端库 git ...
- OSGI入门笔记
OSGI框架为Java定义了一个动态模块化系统,它使你可以更好地控制代码结构,动态管理代码的生命周期,并且提供了代码写作的松耦合方式:更值得称道的是,它的规范文档描述详尽.--<OSGI实战&g ...
- SQL Server调优系列基础篇(常用运算符总结——三种物理连接方式剖析)
前言 上一篇我们介绍了如何查看查询计划,本篇将介绍在我们查看的查询计划时的分析技巧,以及几种我们常用的运算符优化技巧,同样侧重基础知识的掌握. 通过本篇可以了解我们平常所写的T-SQL语句,在SQL ...
- EF Power Tools的Reverse Engineer Code First逆向生成Model时处理计算字段
VS2013上使用EF Power Tools的Reverse Engineer Code First逆向生成Model时,没有处理计算字段.在保存实体时会出现错误. 可以通过修改Mapping.tt ...