How to fix "Repository is X commits ahead of [origin]" #195692
Replies: 5 comments 4 replies
|
This is not an error — it simply means your fork contains 7 commits that are not in the original repository yet. When you fork a repository on GitHub If your goal is to contribute those fixes, the next step is to open a Pull Request from your fork to the original repository. Once the repository owner reviews and merges your Pull Request, your fork and the original repository will be in sync again, and the “ahead” message will disappear. If you do not want to keep those 7 commits, you can discard them and reset your fork to match the original repository. On GitHub To prevent confusion in the future, it helps to remember that “ahead” is not a problem to fix. It simply indicates that your fork contains commits that have not yet been merged upstream. This is the normal state whenever you make changes in your own fork. So in your case, if those 7 commits are the fixes you intended to contribute, everything is working as expected and you should create a Pull Request rather than trying to remove the message. |
@dohyeon5626 It is not offering me that option. |
As I told you, @dohyeon5626 , it's not offering me the option to discard the 7 commits. |
|
This is normal and not an error. Your fork is “7 commits ahead” because you made 7 changes that do not exist in the original repository yet. That is exactly how forks are supposed to work when you contribute fixes. You do not need to delete or re-fork the repository. The usual next step is to create a Pull Request so the original repository owner can review and merge your changes. Once merged, your fork will usually sync up again. You can safely ignore rebasing for now, especially if you are only using GitHub Desktop and are new to GitHub. |
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
Body
Hello Github,
I'd like to preface this with the following:
I've got one repository that I forked off of someone to help with fixing some small issues. I'm not great at code, but I'd recognized some oversights that I offered to fix and I did. I have, however, absolutely no idea how Github works. The forked Repo now says that I'm 7 commits ahead of the repo I forked it off of. I'd like that error not to be there, but I can't find a way to sync my fork with the original fork again so that it's not ahead anymore. I've looked around and saw some tutorials that mention rebasing, but because my fork is not behind it's now allowing me to do that.
I'd very much like to not have to delete and re-fork the repo if I can since that removes contributor attributions. Can anyone please tell me what I can do to fix it and prevent it in the future? When explaining, assume I know absolutely nothing about this, because I don't.
All reactions