0

I installed the project from USB. I developed some classes (java project). Then I called remote on git, trying to checkout "master", but it says:

Please move or remove them before you can switch branches.
Aborting

If I remove them, I will lose my files. If I stash them, then unstash after the "master" check out, would this be a solution?

To test, I only committed one file to another branch. When I try to compare that branch with "master", github says:

There is nothing to compare

One file is not important, but I have lots of files. What should I do?

SOS
  • 6,430
  • 2
  • 11
  • 29
  • 2
    Please post the actual commands you are entering and their full output. – Melebius Apr 17 '18 at 12:32
  • i did not write any commands.just trying to create pr from github @Melebius – caner aydin Apr 18 '18 at 06:16
  • Well, as you wrote _“I called `remote` on git”_, I really thought you were running the [`git remote`](https://git-scm.com/docs/git-remote) command. So what are you using actually? GitHub webpage, GitHub desktop app, …? Being as specific as possible allows getting answers that are actually useful in _your_ case. You should also explaing what do you mean by _“I installed the project from USB.”_ Was it Git cloning, simple copy of a Git repository or a copy of files that were put to Git in a different place? – Melebius Apr 18 '18 at 06:27
  • in past i used it yes , now i am on remote. usb files are not part of git. Only small part of usb files were pushed to master. it is hybris electronic store zip. i pushed only custom files to master at first, not all usb zip – caner aydin Apr 18 '18 at 10:02
  • You used _what_ in past? You tagged the question [tag:git] and [tag:github], so I am expecting you are trying to get help with some of this software. What do you mean by “now i am on remote”? Remote is, well, remote. One works on local repo in the Git ecosystem and only sync it with remote(s). – Melebius Apr 18 '18 at 10:07

1 Answers1

1

You can indeed stash it, switch branch, and unstash it. But the best practice would be to push on your actual branch, then merge the branch on master when you're sure that everything is ok.

RoadEx
  • 543
  • 2
  • 12
  • it says `There isn’t anything to compare. master and qqqq are entirely different commit histories.` i cant merge :( – caner aydin Apr 17 '18 at 10:52
  • 1
    Maybe this would help : https://stackoverflow.com/questions/23344320/there-isnt-anything-to-compare-nothing-to-compare-branches-are-entirely-diffe – RoadEx Apr 17 '18 at 12:02