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 判断SIM卡属于哪个移动运营商
第一种方法:获取手机的IMSI码,并判断是中国移动\中国联通\中国电信 TelephonyManager telManager = (TelephonyManager) getSystemServic ...
- 【代码笔记】iOS-看图听故事
一,效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> #import <AVFoundation/AVFo ...
- django 微信企业号 返回text消息
from django.template import Context,Template textTemplate=""" <xml> <ToUserN ...
- python 判断学期与学年
9,10,11,12,1 第一学期 2,3,4,5,6,7 第二学期 其中8月份放假,暂且放入第一学期.因为大部分学校都选在8月底开学 import datetime def getXNandXQ() ...
- tomcat常见错误及解决方案
一,tomcat启动时错误 1:The JAVA_HOME environment variable is not defined This environment variable is neede ...
- 自动化部署教程(一) redhat安装jenkins
自动化部署教程(一) redhat安装jenkins 源配置: sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.or ...
- 见证历史 -- 2013 NBA 热火夺冠之路有感
见证历史-- 2013 NBA 热火夺冠之路有感今年NBA季后赛从第一轮看起,到最终的热火夺冠,应该看得是最爽的一次.但一些情节和细节,回忆起来,深有感悟. 1. 做人要低调詹宁斯豪言演黑八雄鹿本赛季 ...
- PHP数据的序列化/反序列化
最近在接触一个叫做medoo的mysql框架,这个框架有一个特点,在insert/update时,如果你给进的数据是array的话会自动转成序列化字符串,说实话这个东西以前还没怎么接触过,索性去搜索了 ...
- RFID应用范围
RFID应用范围 (1)物流: 物流过程中的货物追踪,信息自动采集,仓储应用,港口应用,邮政,快递 (2)零售: 商品的销售数据实时统计,补货,防盗 (3)制造业: 生产数据的实时监控,质量追踪,自动 ...
- Log4j 输出的日志中时间比系统时间少了8小时的解决方法,log4j日志文件重复输出
1. 第一个问题:时间少了8小时 Log4j 输出的日志中,时间比系统时间少了8小时,但是 eclipse 控制台输出的日志的时间却是对的. log4j配置如下: #all logger output ...