首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >Git学习笔记(7) -- 独立开发者所用的命令(c)

Git学习笔记(7) -- 独立开发者所用的命令(c)

作者头像
EltonZheng
发布2021-01-22 07:35:07
发布2021-01-22 07:35:07
4350
举报

这次我们看一些实例

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

代码语言:javascript
复制
$ tar zxf frotz.tar.gz
$ cd frotz
$ git init
$ git add . //添加所有文件到index
$ git commit -m "import of frotz source tree."
$ git tag v2.43

Create a topic branch and develop.

代码语言:javascript
复制
$ 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.

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档