-1

I want to keep track on 2 repo with the SAME NAME created SEPARATELY. 1 is in local machine and 1 is in remote.

But whenever I pressed "publish repository" after "commit to production", there was a red warning saying that "Repository creation failed. (name already exists on this account)".

So my question is, is there any way for me to keep track on the code history of these 2 repo?

Thank you.

  • "is there any ways to overwrite the remote one with my local one using Github DESKTOP without deleting the remote one?" Unfair question, since deleting the remote one is _exactly_ how to do this. Either remove that restriction or remove the requirement to use GitHub Desktop. – matt May 05 '22 at 13:10
  • @matt Thank you for your attention. What if I want to keep track on the repo history between this 2 repo? Deleting and then create a brand new remote one seems can't do I want? – wongwong3000 May 05 '22 at 13:16
  • But "overwrite" means remove the old history and replace it with a different history. You are contradicting yourself. The repository _is_ the history, and you yourself said "I am trying to overwrite my remote repository with my local one". Now suddenly you _don't_ want to do that? What _do_ you want to do then? – matt May 05 '22 at 13:19
  • @matt Thank you for pointing out my mistake. I revised my question now. – wongwong3000 May 05 '22 at 13:27

1 Answers1

0

I'm going to assume that when you say "repo" you mean "branch" (a big stretch, I know), and that the situation is something like this: GitHub has this:

A -- B -- C (mybranch)

But you on your local machine have this:

X -- Y -- Z (mybranch)

And I take it that what you want is this, on both:

A -- B -- C -- X -- Y -- Z (mybranch)

The way to obtain that is as follows:

git fetch
git switch mybranch
git rebase --keep-empty origin/mybranch
git push origin mybranch

You will observe that I have not limited myself to the restriction that this should be done using GitHub Desktop alone. I don't know whether it has the power to do this (and I don't really care).

matt
  • 515,959
  • 87
  • 875
  • 1,141