zoukankan      html  css  js  c++  java
  • Git学习笔记(7) — 独立开发者所用的命令(c)

    这次我们看一些实例

    Use a tarball as a starting point for a new repository.

    1 $ tar zxf frotz.tar.gz
    2 $ cd frotz
    3 $ git init
    4 $ git add . //添加所有文件到index
    5 $ git commit -m "import of frotz source tree."
    6 $ git tag v2.43

    Create a topic branch and develop.

    $ git checkout -b alsa-audio (1)
    $ edit/compile/test
    $ git checkout -- curses/ux_audio_oss.c (2)
    $ git add curses/ux_audio_alsa.c (3)
    $ edit/compile/test
    $ git diff HEAD (4)
    $ git commit -a -s (5)
    $ edit/compile/test
    $ git reset --soft HEAD^ (6)
    $ edit/compile/test
    $ git diff ORIG_HEAD (7)
    $ git commit -a -c ORIG_HEAD (8)
    $ git checkout master (9)
    $ git merge alsa-audio (10)
    $ git log --since='3 days ago' (11)
    $ git log v2.43.. curses/ (12)
    1. create a new topic branch.
    2. revert your botched changes in curses/ux_audio_oss.c.
    3. you need to tell git if you added a new file; removal and modification will be caught if you do git commit -a later.
    4. to see what changes you are committing.
    5. commit everything as you have tested, with your sign-off.
    6. take the last commit back, keeping what is in the working tree.
    7. look at the changes since the premature commit we took back.
    8. redo the commit undone in the previous step, using the message you originally wrote.
    9. switch to the master branch.
    10. merge a topic branch into your master branch.
    11. review commit logs; other forms to limit output can be combined and include –max-count=10 (show 10 commits), –until=2005-12-10, etc.
    12. view only the changes that touch what’s in curses/ directory, since v2.43 tag.
  • 相关阅读:
    Java中使用责任链模式
    Java中使用策略模式
    C++字符画圈
    C/C++结构体
    C++判断闰年&日期之差&给定日期求星期几
    C++重载<运算符及排序结构体
    Spring Boot笔记 #02# 构建RESTful Web服务(官方)
    IntelliJ IDEA修改默认的全局Maven路径
    Spring Boot笔记 #01# 快速入门(官方)
    获取某个时间的前一天
  • 原文地址:https://www.cnblogs.com/chenbin7/p/2625891.html
Copyright © 2011-2022 走看看