英文:
Can't make a pull request
问题
我有这个存储库,是从另一个存储库fork过来的,现在我需要向它提交一个拉取请求,但它显示:“没有可比较的内容”,而且我的提交不显示:
https://github.com/amorimll/desafio-sharenergy-2023-01
任何帮助都将不胜感激,我真的需要在今天完成这个。
这是在git rebase中显示的:
英文:
I have this repository that i forked from another one, and now i need to make a pull request to it, but it says that: "There isn’t anything to compare.", and my commits are not showing:
https://github.com/amorimll/desafio-sharenergy-2023-01
Any help is appreciated, really need this for today.
This is showing in the git rebase:
答案1
得分: 1
"Short answer: 将检出到您的main
分支以获取最新代码,然后返回到您当前正在工作的分支并执行git rebase [currentBranchName] main
。
Explain: 当您从另一个分支创建分支时,就好像在那一刻从该分支创建了代码快照。理想情况下,您从中复制的分支应该尽量避免进行任何更改,直到您完成在新分支上的工作并创建了PR
并完成合并。rebase
命令的作用是,如果原始分支有更改,它将首先从该分支中提取最新的代码到您的工作分支,然后应用您对当前工作分支所做的任何更改。通常,这个过程需要解决一些冲突,如果它们修改了相同的文件。
希望这有助于您理解 :)"
英文:
Short answer
will be checkout to your main
branch get the lastest code, then go back to your current working on branch and do git rebase [currentBranchName] main
Explain
so when your create a branch from another branch, is like your created a snapshot code from that branch at that moment. ideally the branch you copied form should prevent make any more changes if possible, until you done working in the new branch and create the PR
and done marge it.
what rebase
command will do is in case the origin branch had changes, it will pull the latest code form that branch into your working branch first, then to applied any changes you was made for your current working branch. Usually this process will need have some conflict need to fix, if they changed the same file.
Hope this is help you understand
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论