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 项目重启屈指可数的模式,好在老项目们表现甚好.比如一周就 ...
随机推荐
- App开发流程之右滑返回手势功能续
上一篇记录了利用系统私有变量和方法实现右滑返回手势功能:http://www.cnblogs.com/ALongWay/p/5893515.html 这篇继续记录另一种方案:利用UINavigatio ...
- 自定义Dialog宽度占满屏幕
一.自定义Dialog继承Dialog public class MyDialog extends Dialog { 二.为Dialog设置样式 在style中建立新样式继承 @android:sty ...
- push notification获取device token
第一步:申请证书: 第二步:申请app ids,应用名字必须一致.然后再进入进行编辑,使其enable,绿灯. 第三步:申请provisioning profile,生成.mobileprovisio ...
- CocoaPods的安装和使用那些事(Xcode 7.2,iOS 9.2,Swift)
Using The CocoaPods to Manage The Third Party Open-source Libaries 介绍 CocoaPods是用来管理你的Xcode项目的依赖库的.使 ...
- Discuz! 经典加密解密函数
function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { $ckey_length = 4; $key = ...
- HTML页面禁止选择、页面禁止复制、页面禁止右键
HTML页面内容禁止选择.复制.右键刚在一个看一个站点的源代码的的时候发现的,其实原来真的很简单 <body leftmargin=0 topmargin=0 oncontextmenu='re ...
- ksvcreate: Process(m000) creation failed
一测试服务器数据库(Oracle Database 10g Release 10.2.0.5.0 - 64bit Production)突然访问不了,检查发现数据库处于挂起模式(hang mode), ...
- Xtrabackup数据全备份与快速搭建从服务器
Percona Xtrabackup可以说是一个完美的数据备份工具.特别是当数据库的容量达到了一定数量级的时候且存在单表达到几十G的数据量, 很难容忍一些逻辑备份的漫长时间.如单个数据库约200G,单 ...
- 不同Framework下StringBuilder和String的性能对比,及不同Framework性能比(附Demo)
本文版权归mephisto和博客园共有,欢迎转载,但须保留此段声明,并给出原文链接,谢谢合作. 文章是哥(mephisto)写的,SourceLink 阅读目录 介绍 环境搭建 测试用例 MSDN说明 ...
- Python标准库(1) — itertools模块
简介 官方描述:Functional tools for creating and using iterators.即用于创建高效迭代器的函数. itertools.chain(*iterable) ...