为什么在我复制我的本地文件夹并切换分支后,提交没有出现在我的 Github 个人资料贡献中?

Why not appear on my Github profile contributions a commit after i copy my folder local and switch branch?

我制作 React 项目并保存 github。

我把我的项目分成不同的大舞台。

当我到达一个更大的舞台时,我也复制了我的本地文件夹并从那里继续。

我还复制了我的 git 文件夹,但没有复制节点模块和包-lock.json ...等,因为我在 npm install

之后重新创建了

现在这点我可以修改保存了github没问题

但是如果我切换分支

 git checkout -b other-branch
 git push --set-upstream origin other-branch

没有在我的个人资料中显示我的贡献?!

更改出现在我正确的分支(其他分支)

来自 github 的常见问题解答: What counts as a contribution:

On your profile page, certain actions count as contributions:

  • Committing to a repository's default branch or gh-pages branch
  • Opening an issue
  • Opening a discussion
  • Answering a discussion
  • Proposing a pull request
  • Submitting a pull request review

因此只有提交到默认分支(mainmasterdevelop 等)才算数,other-branch 不会,除非您将其定义为默认分支.