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

[Question] About issue number. #17

Open
jwen-wj opened this issue Apr 23, 2021 · 3 comments
Open

[Question] About issue number. #17

jwen-wj opened this issue Apr 23, 2021 · 3 comments
Labels
kind/question Category issues related to questions or problems

Comments

@jwen-wj
Copy link
Contributor

jwen-wj commented Apr 23, 2021

What's the problem

我想请问一下,upstream和origin之间的issue问题。我们在提交PR的时候遇到这么一个问题:

如果我从当前仓库fork一份项目内容到组长的origin之后,其他成员去fork组长的仓库,把组长的origin作为其他组员的upstream。
然后我在组长的仓库中提了一个任务分工的issue,所有的成员在提交commit的时候,都去关联这个issue。
git commit -m "docs: add content XXX(#issue_id),这个issue_id在组长的仓库里面是可以正确关联到相应的issue的。
但是当组长向上游提交PR的时候,这些commit关联的issue又变成关联上游的issue_id。

请问是我的操作问题,还是git关联的issue本身就是这样的逻辑呢?( 我觉得是前者:D )
image
image

@open-digger-bot open-digger-bot bot added the kind/question Category issues related to questions or problems label Apr 23, 2021
@jwen-wj jwen-wj changed the title [question] About issue number. [Question] About issue number. Apr 23, 2021
@leofang327
Copy link
Contributor

leofang327 commented Apr 23, 2021

这是正常的,如果你只填写#num,那么这个#num在哪个仓库被解析,num就会对应到该仓库的issue/PR id。
实际上对于你这种多上游仓库的情况,可以在写commit messge关联issue的时候,填写完整的issue url来区分具体是哪个仓库的issue,而非只填写issue id。

例如:这里我的commit messge填的是一个issue的url
image

在仓库中会被解析成对应的issue id
image

@jwen-wj
Copy link
Contributor Author

jwen-wj commented Apr 23, 2021

谢谢学长的答疑

@frank-zsy
Copy link
Contributor

@leofang327 说的方法非常好,但我个人建议区分 Git 与 GitHub 协作,commit 属于 Git 协作范畴,对于 Issue 的关联可以在 PR 中进行,不一定需要直接在 commit message 中关联 GitHub Issue。不过只是个人习惯,对于纯 GitHub 协同项目而言,在 commit message 中关联 Issue 也是没有问题的,但最好是以完整链接方式,无论是否存在多仓库关联错误的问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Category issues related to questions or problems
Projects
None yet
Development

No branches or pull requests

3 participants