githubteacher / fluffy-octo-guacamole

demo and practice repo for May 2016 GitHub for Developers class
14 stars 15 forks source link

Can't create pull request. I get "There isn’t anything to compare." #242

Open cmirrop opened 8 years ago

brianamarie commented 8 years ago

@cmirrop Make sure you are comparing branches correctly. It should say "Base: master" and "Compare: ".

cmirrop commented 8 years ago

master is up to date with all commits from update-cam-bio. Try switching the base for your comparison.

brianamarie commented 8 years ago

@cmirrop Okay. In your command line, what is the output if you type git status?

cmirrop commented 8 years ago

untracked files: update-cam-bio

nothing added to commit but untracked files present

brianamarie commented 8 years ago

@cmirrop Ah, I think I know what's wrong! Make sure you're on your own branch, then try:

Then try again to create a pull request.

johnnyxyz1223 commented 8 years ago

I think I did that, but I'm having the same problem

cmirrop commented 8 years ago

I did that, got the same problem.... master is up to date with all commits from update-cam-bio. Try switching the base for your comparison.

brianamarie commented 8 years ago

@johnnyxyz1223 @cmirrop If you have done those steps and continue to have the same result, make more changes locally so there will be a difference. Then go through the steps above.

cmirrop commented 8 years ago

Too much to try to catch up and get this to work... Missing the instructions for what's next.... I'm losing the train of the class...

brianamarie commented 8 years ago

@cmirrop Don't worry, we are going to take a break soon and I'll help you get all caught up. 👍

cmirrop commented 8 years ago

I missed the merged thing, too. I don't know what he's talking about now.

brianamarie commented 8 years ago

@cmirrop I know you're feeling very behind, but I don't think you're as behind as you think you are. Thank you for being so patient! Here are the next steps:

Send our changes up to GitHub

Create a pull request

Merging the pull request

cmirrop commented 8 years ago

When I typed in atom update-cam-bio, all my previous changes were gone. It opened a blank file.

brianamarie commented 8 years ago

@cmirrop Is update-cam-bio the name of your branch, or the name of your file?

cmirrop commented 8 years ago

I thought it was the file??

cmirrop commented 8 years ago

Maybe I don't understand how branches vs files are working.

brianamarie commented 8 years ago

@cmirrop The file probably had an .md extension, like update-cam-bio.md. If not, you can create one in the command line with touch update-cam-bio.md, then open it with atom the same way you were trying.

Aah, branches vs. files, I see how that could be confusing. A branch is a separate copy of the entire repository, and it is made up of all of the files. I will find some more resource to help clarify.

cmirrop commented 8 years ago

When I type in dir, only a bios folder shows up. I guess I lost all my work.

brianamarie commented 8 years ago

@cmirrop What does it output if you type ls -al within the bios folder?

cmirrop commented 8 years ago

ls is not a recognized command

cmirrop commented 8 years ago

I have to use dir

brianamarie commented 8 years ago

@cmirrop Ah, I'm sorry, I forgot that you're on a windows machine. After you cd bios, what is the output from dir -al?

brianamarie commented 8 years ago

@cmirrop If you could use Git Bash, it will alleviate some of these hiccups. I appreciate your patience - it sounds like you have some frustrating issues coming up. 😞

cmirrop commented 8 years ago

Volume in drive C is OSDisk, Volume Serial Number is 8835-BCD1, File not found

brianamarie commented 8 years ago

@cmirrop Okay, thank you.

Is there any way you could use Git Bash for these next steps?

cmirrop commented 8 years ago

I have no idea. What's wrong with Git CMD?

brianamarie commented 8 years ago

@cmirrop If you're using powershell or command line, it won't recognize the *ix commands. Have you downloaded Git through Git-scm.org of through the GitHub desktop app?

cmirrop commented 8 years ago

It looks like the class is starting and I dont' have a clue.... :-1:

brianamarie commented 8 years ago

@cmirrop For now, I don't want you to get too overwhelmed. I suggest watching Patrick finish these next steps and you will have the video and notes to review later.

cmirrop commented 8 years ago

I haven't used a bash shell in 20 years, and I won't be using that at work.

hectorsector commented 8 years ago

Sorry you're having some trouble @cmirrop let me see if I can help. @brianamarie was recommending to use Git Bash so that you could follow along with Patrick's commands. Git will certainly allow you to use whichever tool you prefer.

What's holding you back right now so I can help you get back on track?

cmirrop commented 8 years ago

At this point, I'll just wait for the video to be released so I can go through it at my own pace. Once I start going through the video, who can I contact for questions?

brianamarie commented 8 years ago

@cmirrop If you have further questions with the video, feel free to contact us at services@github.com. You also might find helpful answers at https://help.github.com/.

NZMia commented 7 years ago

I got the same error. But I found the error result from without git commit before git push, in my case.

mmeli commented 5 years ago

I have the same issue here

Salem-Abderaouf commented 4 years ago

@cmirrop make git merge <otherBranch> to merge the branches, then git pull (git url) master --allow-unrelated-historiesto update your local master branch to your remote master branch. Now that your local master branch has the commits of and is up to date with the commits from the remote, now your are able to git push --set-upstream origin master. to your github's master branch now has the commits of your .

nithin1097 commented 4 years ago

There isn’t anything to compare. im having this issue

brianamarie commented 4 years ago

Hi @nithin1097! To create a pull request, you need at least two branches. The branch with changes, which you would like to add to the other branch, needs to have at least one commit that introduces a change from the other branch. Do you have this set up? (If you have this going in a public repository so I could take a look, or if you have any screenshots, that could be helpful too.)

The https://github.community/ community forum may also be a better place to get help in the future. 😊

nithin1097 commented 4 years ago

Hi @nithin1097! To create a pull request, you need at least two branches. The branch with changes, which you would like to add to the other branch, needs to have at least one commit that introduces a change from the other branch. Do you have this set up? (If you have this going in a public repository so I could take a look, or if you have any screenshots, that could be helpful too.)

The https://github.community/ community forum may also be a better place to get help in the future.

git

brianamarie commented 4 years ago

Ah, I see @nithin1097! You can see it says, "master and developer are entirely different commit histories". It appears that the two branches share no common commit that could tell them were to merge. Did you create the branch developer from master after master already had one commit, or before? If before, I would recommend

nithin1097 commented 4 years ago

I didn't get ur point.

On Wed, Jul 15, 2020, 3:13 PM Briana Swift notifications@github.com wrote:

Ah, I see @nithin1097 https://github.com/nithin1097! You can see it says, "master and developer are entirely different commit histories". It appears that the two branches share no common commit that could tell them were to merge. Did you create the branch developer from master after master already had one commit, or before? If before, I would recommend

  • Creating a new branch off of master
  • Then locally, use git cherry-pick fdd910e990c1bba6ec40a61f2ffaa281ed3619fa on the new branch.
  • Then, you will be able to open a pull request with base master and compare (the new branch).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/githubteacher/fluffy-octo-guacamole/issues/242#issuecomment-658665174, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQHEJVTQPKFXZYPANZLKEK3R3V22HANCNFSM4CDVB3MA .

brianamarie commented 4 years ago

Ok. I'm sorry that wasn't helpful @nithin1097 - If you have the repository locally and are able to follow those instructions, then you should be in good shape. If that's not making sense, I recommend asking in https://github.community/ or searching the internet for the error message "master and branch are entirely different commit histories". Best of luck!

vishvavijay commented 3 years ago

Same issue.

JithinAji commented 3 years ago

I too had a similar problem but solved the same with the following commands.

git checkout [BRANCH]
git branch master [BRANCH] -f
git checkout master
git push origin master -f

For more detailed description you can check this stack overflow link. more info

TaherZiyaee commented 3 years ago
  1. first pull from remote repo
  2. merge or rebase
  3. finally push to remote repo
  4. finish
mahsaalikhani92 commented 3 years ago

I too had a similar problem but solved the same with the following commands.

git checkout [BRANCH] git branch master [BRANCH] -f git checkout master git push origin master -f

For more detailed description you can check this stack overflow link. more info

Hi, it is worked for me but I really don't know what happened, can you explain how it works? There is another problem: the merge that done by my team member before is already gone! and my branch is on the master now. Why this happened?

JithinAji commented 3 years ago

The reason is explained in the stack overflow link that I have given there.

"You probably downloaded the original source and added it to a completely new repo instead of cloning the original repo, right? Doing that will make it so that the history of your repo will be completely different from the history of the original repo, since your new repo won't have any of the same commits with the same sha IDs."

For me this is exactly what happened. What my code is doing is deleting the entire branch from remote repo and adding a copy of your local files to remote repo. That is why your team members changes are gone now.

Looking back at my solution I dont think it is a good one. Next time you can use git clone command to download the repo and this error wont be happening. If you want to go back to the previous commits to get your team members changes you can always use git reset command to do rollback. :)

mahsaalikhani92 commented 3 years ago

The reason is explained in the stack overflow link that I have given there.

"You probably downloaded the original source and added it to a completely new repo instead of cloning the original repo, right? Doing that will make it so that the history of your repo will be completely different from the history of the original repo, since your new repo won't have any of the same commits with the same sha IDs."

For me this is exactly what happened. What my code is doing is deleting the entire branch from remote repo and adding a copy of your local files to remote repo. That is why your team members changes are gone now.

Looking back at my solution I dont think it is a good one. Next time you can use git clone command to download the repo and this error wont be happening. If you want to go back to the previous commits to get your team members changes you can always use git reset command to do rollback. :)

Thank you, I got it.

srvn-nm commented 2 years ago

My collaborator forked my repo and has this issue "there is nothing to compare" how can we handle this?

srvn-nm commented 2 years ago

And we don't want to erase non of our commits