0

I am thoroughly confused by the git workflow and have managed to somehow lose my local project directory files after running a git rebase command (after multiple failed attempts to merge). I suspect that it was rebased on the empty master branch, which is why now my local directory only has a readme file, but I'm honestly not sure what's up.

So, now my project files are in the dev branch and the master branch is empty. How can I restore my project from the dev branch and then effectively merge the two such that my existing changes are populated within the master branch?

SO questions I have reviewed to troubleshoot this, but weren't ultimately that helpful...

Merging Select Changes

When to Merge vs Rebase


UPDATE

One can clone a specific branch using the following git command:

git clone -b {branch_name} {url_for_repo}

See this SO question for details:

Merv Merzoug
  • 1,149
  • 2
  • 19
  • 33
  • 2
    Did the rebase finish? If not `git rebase --abort` to revert. If not run `git reflog` to try and go back to previous commits. – EncryptedWatermelon Jul 18 '19 at 20:00
  • 1
    It might be helpful if you post your git command line history to show exactly what you did, and what messages you saw that showed that the merge failed. What does it say if you run `git status`? – Marie Jul 18 '19 at 20:06
  • It's worth pointing out that there is no such thing as an "empty branch". A branch name, like `dev` or `master`, just identifies one particular commit. That one particular commit has a *parent*, and its parent has another parent, and so on; it is this chain of parent links that forms the useful thing that is also (confusingly) called a *branch*. The *name* just identifies the *last* commit that is in the branch. – torek Jul 18 '19 at 20:57

0 Answers0