Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 701  / 3 Years ago, thu, august 19, 2021, 2:31:27

I have a local GIT repository in my system by name 'git_repo' under which I had the whole codebase for a website (pre-configured by someone else), including all the jsps, js, css etc.



I used the following commands to create the local git repository out of the main repository:



git branch //to show the current branch
git checkout -b branch_local_name origin/Main_branch_name //to create local repository in current branch
git fetch //to fetch the current build


Accidentally, I deleted all the contents of the local folder and I don't know what to do fetch the contents of that website again.


More From » git

 Answers
0

Could you simply use clone?



 git clone <remote-repo> <local-dir-that-is-empty>


After doing this, you can do branching and stuff.



Running these commands in succession should do it:



cd ~
mkdir new_repo
cd new_repo
git clone <path-to-repo> .

[#35150] Thursday, August 19, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
measord

Total Points: 259
Total Questions: 131
Total Answers: 106

Location: Venezuela
Member since Sun, Oct 2, 2022
2 Years ago
;