<!-- generator=" CodePongo (Base on Kukkaisvoima version 15b3TA)" -->
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<channel><title>CodePongo: git</title><link>http://codepongo.com/blog</link><description></description><pubDate>Fri, 20 Jun 2014 17:30:06 +0200</pubDate><lastBuildDate>Fri, 20 Jun 2014 17:30:06 +0200</lastBuildDate><generator>http://codepongo.com/blog</generator><language>zh-cn</language><item><title>Roll Back with GIT GIT回滚
</title><link>http://codepongo.com/blog/FGiuC</link><comments>http://codepongo.com/blog/FGiuC#comments</comments><pubDate>Fri, 20 Jun 2014 17:30:06 +0200</pubDate><dc:creator>zuohaitao</dc:creator><category>git</category><guid isPermaLink="false">http://codepongo.com/blog/FGiuC/</guid><description><![CDATA[ 
 [...]]]></description><content:encoded><![CDATA[

force reset to the version of the last two 
取消当前版本之前的两次提交



git reset --hard HEAD~2 



force push to the remote re
强制提交到远程版本库，从而删除之前的两次提交数据



git push origin HEAD --force


]]></content:encoded><wfw:commentRss>http://codepongo.com/blog/FGiuC/feed/</wfw:commentRss></item><item><title>Create a Subversion Mirror Repository In Github
</title><link>http://codepongo.com/blog/5WgRa</link><comments>http://codepongo.com/blog/5WgRa#comments</comments><pubDate>Fri, 21 Mar 2014 17:30:06 +0200</pubDate><dc:creator>zuohaitao</dc:creator><category>git</category><guid isPermaLink="false">http://codepongo.com/blog/5WgRa/</guid><description><![CDATA[ 
 [...]]]></description><content:encoded><![CDATA[
在Github上建立一个SVN的镜像库

1.Create repository 创建库

2.clone the git repository 克隆代码至本地


$git clone git@github.com:user-name/repository-name


3.set svn as a remote repository 把svn仓库添加为远程仓库


$git svn init -T http://url/svn/trunk/


4.fetch 获取svn仓库的代码


$git svn fetch


5.show all branch 显示所有分支


$git branch -a
* master
 origin/master
  remotes/origin/master
  remotes/origin/trunk


remotes/trunk is the svn branch 其中，remotes/trunk为svn分支

6.merge 合并svn分支


$git merge trunk


7.push 推送至github


$git push


refference

在GitHub上建立一个SVN仓库的镜像

]]></content:encoded><wfw:commentRss>http://codepongo.com/blog/5WgRa/feed/</wfw:commentRss></item><item><title>Combine some commits of GIT in one Git合并多条提交记录
</title><link>http://codepongo.com/blog/3olKZu</link><comments>http://codepongo.com/blog/3olKZu#comments</comments><pubDate>Fri, 07 Mar 2014 17:30:06 +0200</pubDate><dc:creator>zuohaitao</dc:creator><category>git</category><guid isPermaLink="false">http://codepongo.com/blog/3olKZu/</guid><description><![CDATA[ 
 [...]]]></description><content:encoded><![CDATA[
show commit count 显示提交记录数


git rev-list HEAD --count


combine commit or modify commit message 合并或修改记录


command 命令



git rebase -i HEAD~$x


其中$x代表你期望操作的记录数，小于提交记录数
$x is the count of commit that you want to combine or change,
$x is less than commit count

如 e.g.


  你想操作最后十条，则$x为10 
  if you want to change the last ten commits, the value of $x is 10.



pick 123456 init
pick 7890ab add text
pick cdef12 modify text
pick 345678 modify text




edit 编辑


change the "pick" that is in front of the commit line to "s",
the commit will combine to previous commit.
在你期望合并的commit将前面的pick更改成s就行，
此条commit将于上一条commit合并

change the "pick to "r", the commit message will be modify.
pick改成r表示修改当前提交信息

e.g.例如：


 "s 345678 modify text"



change commit message after saving 保存后，重新编写提交信息



 # This is a combination of 2 commits.
 # The first commit's message is:

 modify text

 # This is the 2nd commit message:

 modify text

 # Please enter the commit message for your changes. Lines starting
 # with '#' will be ignored, and an empty message aborts the commit.
 # HEAD detached at 8658d47
 # You are currently editing a commit while rebasing branch 'master' on 'ddcff57'.
 #
 # Changes to be committed:
 #   (use "git reset HEAD^1 ..." to unstage)
 #
 #  new file:   ignorelist
 #  modified:   README.md
 #
 # Untracked files:
 #   (use "git add ..." to include in what will be committed)
 #



 change text

 # Please enter the commit message for your changes. Lines starting
 # with '#' will be ignored, and an empty message aborts the commit.
 # HEAD detached from 18e598b
 # You are currently editing a commit while rebasing branch 'master' on 'ddcff57'.
 #
 # Changes to be committed:
 #   (use "git reset HEAD^1 ..." to unstage)
 #
 #  new file:   README.md
 #
 # Untracked files:
 #   (use "git add ..." to include in what will be committed)
 #



push 推送至远程



git push -f


]]></content:encoded><wfw:commentRss>http://codepongo.com/blog/3olKZu/feed/</wfw:commentRss></item><item><title>Github Useful Help github帮助
</title><link>http://codepongo.com/blog/144eSB</link><comments>http://codepongo.com/blog/144eSB#comments</comments><pubDate>Sat, 06 Apr 2013 17:30:06 +0200</pubDate><dc:creator>zuohaitao</dc:creator><category>git</category><guid isPermaLink="false">http://codepongo.com/blog/144eSB/</guid><description><![CDATA[ 
 [...]]]></description><content:encoded><![CDATA[

Register 注册
Create repository 创建库 
新建库
可以在任何有权限的账户上创建库，无论是个人或组织帐号


在任意页面的右上角的用户条，点击“Create a New Repo"按钮
选择创建库的帐号
输入库名字，选择库类型public公有或private私有；然后点击“Create repository”

Delete repository 删除库
删除库


切换至要删除的库
选择库操作条上的“Settings”
点击“Delete this repository”在Danger Zone 区域
阅读警告，输入库名
点击“I understand the consequences, delete this repository”

Establish a secure connectio
SSH Keys
如果决定不使用推荐的HTTPS方法,也能用SSH keys去建立一个安全的终端到github的链接,
下面的步骤将引导你产生一个SSH key然后加入公钥到github帐号


检查SSH keys
首先，我们需要检查一个存在的ssh keys在你的计算机。
cd ~/.ssh
如果没有文件或路路，那么进行第二步，否则密钥对已存在那么跳到第三步。
产生新的SSH key
产生新的SSH key
ssh-keygen -t rsa -C "your_email@example.com"
加入SSH key到GitHub
拷贝公钥到剪切版 ~/.ssh/id_rsa.pub

进入账户设置“Account Settings”
点击侧栏的“SSH Keys”
点击“Add SSH key”
黏贴公钥到“Key”区域
点击“Add key”
确认密码后，添加成功

测试
ssh -T git@github.com



]]></content:encoded><wfw:commentRss>http://codepongo.com/blog/144eSB/feed/</wfw:commentRss></item><item><title>GIT Tutorial GIT指南
</title><link>http://codepongo.com/blog/XON4x</link><comments>http://codepongo.com/blog/XON4x#comments</comments><pubDate>Mon, 11 Mar 2013 17:30:06 +0200</pubDate><dc:creator>zuohaitao</dc:creator><category>git</category><guid isPermaLink="false">http://codepongo.com/blog/XON4x/</guid><description><![CDATA[ 
 [...]]]></description><content:encoded><![CDATA[

Repository Configure 库配置


git init --bare name.git
initial an empty git repository 初始化一个空git库

Local Setting 本地配置


git config user.name name
设置用户名 set user name 
git config user.email email
设置email地址 set user email 

Status 状态查询


git log --oneline --graph
显示日志
show log
git status -s
显示工作区状态
show work box status 

Box - Stage 工作区和暂存区


git add -A
加入所有修改至缓存区
add file new file, removing file and motified content to stage 
git add -u
加入修改内容至缓存区
update motified content to stage 
git rm file
移除文件
remove file from work box and stage 


git diff
比较工作区和暂存区
compare stage with HEAD(local Repository) 

git checkout -- file
从缓存区恢复至工作区
restore file in work box from stage 

Stage - Repository 暂存区和库


git reset, git reset HEAD, git reset -- file
用库重置暂存区
restore stage from repository 
git diff --cached
比较暂存区和库
compare stage with HEAD(local Repository) 
git commit -m 'message'
提交缓存区至库
commit stage to repository 

Box - Repository 工作区和库


git diff HEAD
比较工作区和库
compare work box with HEAD(local Repository) 

Repository - Stage - Box


git reset --hard HEAD
用库恢复工作区和暂存区
restore work box and stage from repository 
git checkout [commit] -- file
检出至工作区和暂存区
checkout  to work box and stage 

Repository 


git reset --soft HEAD^
还原至上一版本
revert to last version(HEAD^) 
git commit --amend -m 'new comment'
modify log 修改版本日志

Local Repository - Remote Repository 本地库和远程库


git clone file://path.name.git
克隆git库
clone git repository
git push
更新远程库
update remote repository 
git pull
获取远程库，合并到本地
fetch and merge remote to local 

With SubVersioN


   
svnadmin create     git init --bare
svn checkout        git clone
svn update          git pull
svn revert          git reset git checkout --
                    git [commit] checkout --
svn add             git add
svn rm              git rm
svn mv              git mv
svn diff            git diff 
                        git diff --cached
                    git diff HEAD
svn status          git status -s
svn commit -m ''    git commit -m '';git push
svn log             git log 



保存当前工作进度


git stash
save work box to the stash
保存进度
git stash list
显示进度列表
list stash
git stash apply
恢复进度
apply a single stashed state on the top of work box
git stash pop
从进度列表移动某个缓存覆盖工作区
remove a single stashed state and apply it on the top of work box
git stash clear
删除所有存储的进度
clean the stash



]]></content:encoded><wfw:commentRss>http://codepongo.com/blog/XON4x/feed/</wfw:commentRss></item></channel></rss>