2

As the title, I want to link local repo to remote.

Description:

  • I have a repo and remote are linked (as normal).
  • I delete the git folder at local repo (I lost local repo).
  • I try to reconnect them by using "git init" and "git remote add origin https://github.com/myrepo.git".
  • The new local is looked like a new empty repo, every subdir or branches on my old repo now untracked (Figure 1).

Figure 1:

enter image description here

Question: What is the git command help me to make the new repo is 100% same the old in the description step 3.

Thank!

Tu Le Anh
  • 91
  • 1
  • 7

1 Answers1

0

You have simply to clone it by git clone https://github.com/myrepo.git.

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74