Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用 GitHub 的正确姿势 #4

Open
ShannonChenCHN opened this issue Apr 9, 2017 · 6 comments
Open

使用 GitHub 的正确姿势 #4

ShannonChenCHN opened this issue Apr 9, 2017 · 6 comments

Comments

@ShannonChenCHN
Copy link
Owner

ShannonChenCHN commented Apr 9, 2017

  • GitHub 能用来干嘛?
  • 为什么要使用 GitHub ?
  • 如何使用 GitHub 管理自己的项目?
  • GitHub 客户端的使用
  • 如何用好 GitHub 打造自己的小天地

关联 issue

@ShannonChenCHN ShannonChenCHN self-assigned this Apr 9, 2017
@ShannonChenCHN ShannonChenCHN changed the title 【撰文】使用 Github 的正确姿势 【学习笔记】使用 Github 的正确姿势 Apr 11, 2017
@ShannonChenCHN ShannonChenCHN changed the title 【学习笔记】使用 Github 的正确姿势 【总结】使用 Github 的正确姿势 May 1, 2017
@ShannonChenCHN ShannonChenCHN changed the title 【总结】使用 Github 的正确姿势 【总结】使用 GitHub 的正确姿势 May 6, 2017
@ShannonChenCHN
Copy link
Owner Author

ShannonChenCHN commented Jun 29, 2017

Github issue template

  • 什么是 issue template
  • 为什么要添加 issue template
  • 如何添加 issue template
  • 如何写 issue template

延伸阅读:

@ShannonChenCHN ShannonChenCHN changed the title 【总结】使用 GitHub 的正确姿势 使用 GitHub 的正确姿势 Jul 2, 2017
@ShannonChenCHN
Copy link
Owner Author

GitHub 是如何统计 contributions 的?

延伸阅读:

@ShannonChenCHN
Copy link
Owner Author

ShannonChenCHN commented Jul 4, 2017

GitHub 项目如何创建 tag?

查看 tag:

$ git tag

创建 tag

$ git tag

对某次 commit 打 tag

$ git tag v1.0.0 your_commit_id

创建带有说明的 tag

$ git tag -a v1.0.0 -m "Release version 1.0.0"

查看 tag 信息

$ git show v1.0.0

删除本地仓库 tag

$ git tag -d v1.0.0

推送本地 tag 到远程

$ git push origin v1.0.0

删除远程仓库 tag

$ git push origin --delete v1.0.0

延伸阅读:

@ShannonChenCHN
Copy link
Owner Author

如何在github上下载单个文件夹?

  1. 将要下载的目录的地址中的 /tree/master/ 换成 /trunk/

  2. svn checkout <下载地址>

@ShannonChenCHN
Copy link
Owner Author

Github 上怎样把新 commits 使用在自己的 fork 上?

方式一: 命令行操作

1、配置上游项目地址。即将你 fork 的项目的地址给配置到自己的项目上。比如我 fork 了一个项目,原项目是 wabish/fork-demo.git,我的项目就是 cobish/fork-demo.git。使用以下命令来配置。

➜ git remote add upstream https://github.com/wabish/fork-demo.git

然后可以查看一下配置状况,很好,上游项目的地址已经被加进来了。

➜ git remote -v
origin  git@github.com:cobish/fork-demo.git (fetch)
origin  git@github.com:cobish/fork-demo.git (push)
upstream    https://github.com/wabish/fork-demo.git (fetch)
upstream    https://github.com/wabish/fork-demo.git (push)

2、获取上游项目更新。使用 fetch 命令更新,fetch 后会被存储在一个本地分支 upstream/master 上。

➜ git fetch upstream

3、合并到本地分支。切换到 master 分支,合并 upstream/master 分支。

➜ git merge upstream/master

4、提交推送。根据自己情况提交推送自己项目的代码。

➜ git push origin master

由于项目已经配置了上游项目的地址,所以如果 fork 的项目再次更新,重复步骤 2、3、4即可。

方式二:直接在 GitHub 官网上操作

  1. 进入你 fork 过来的项目主页,也就是属于你自己的那个 repo。

  2. 点击 compare 按钮。

  3. 切换要创建 pull request 的分支,实际上也就是说,由 upstream 分支向你的分支提 pull request。

  4. 提交 pull request。

  5. merge pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant