Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

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> .
share|improve this answer
    
can u guide me with reference to this>> –  vipin8169 Oct 4 '12 at 10:02
    
vverma@l-vverma:~/git_repo/nextag$ git branch BR_PS_1109 * br_ps master vverma@l-vverma:~/git_repo/nextag$ git clone BR_PS_1109 fatal: repository 'BR_PS_1109' does not exist vverma@l-vverma:~/git_repo/nextag$ git clone br_ps fatal: repository 'br_ps' does not exist vverma@l-vverma:~/git_repo/nextag$ git clone master fatal: repository 'master' does not exist –  vipin8169 Oct 4 '12 at 10:03
    
I've added more instructions to my answer. You will need to provide the full path to the respository. –  Kalle Elmér Oct 4 '12 at 10:10
    
path is ind-git.corp.nextag.com –  vipin8169 Oct 4 '12 at 10:19
    
You will need to prepend the protocol to use for the connection. You can try git clone git://ind-git.corp.nextag.com . or git clone ssh://ind-git.corp.nextag.com . As far as I can tell, however, the domain ind-git.corp.nextag.com doesn't even exist. –  Kalle Elmér Oct 4 '12 at 10:23
show 3 more comments
$ git branch -a | grep BR_SO // to show all the branches
$ git checkout -b bug-<Jira_ID> origin/BR_<name> // make fix in the BR
$ git fetch

and this will solve it

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.