2

I was working on an Android project in Eclipse and I then decided to Git it. Being new, instead of creating a local repository in the parent of the project, I ended up creating it in C:\Users\Little\.git\LocalRepository.

Now, I am facing a lot of problems in my Android project; specifically with adding user libraries to my build path.

Based on this answer here:
Eclipse will not recognize project as library (ActionBarSherlock/ViewPagerIndicator)

I have imported all the user libraries to my workspace. However, my project itself is in a different folder and hence I am stuck. There is also a comment on the answer which says:

Thanks. In my case, I forgot that my project was imported from git and was physically located in another folder than all other projects.

I believe I have to do the same. How do I get the project from local repo to my workspace?

Community
  • 1
  • 1
An SO User
  • 24,612
  • 35
  • 133
  • 221
  • use rm -rf .git to delte repo and clone it in dir u want – KOTIOS Jul 18 '14 at 10:42
  • @adcom I have made one push to my remote repository after the local repo was created. So, I hope I wont screw things up when I delete it, will I? Maybe I should do another push just to be safe – An SO User Jul 18 '14 at 10:43
  • do git status --> for more to be safe to git stash --> git pull --> git stash pop or u can rar ur repo and execute above command which i posted and clone rfersh repo in ur worksapce – KOTIOS Jul 18 '14 at 10:44
  • @adcom Eclipse steps please :D I am learning Git command line but for now I will stick with Eclipse GUI – An SO User Jul 18 '14 at 10:45
  • ohh u hv git bash? which os? ubuntu?windowS? – KOTIOS Jul 18 '14 at 10:46
  • @adcom Windows 7 and Eclipse Juno – An SO User Jul 18 '14 at 10:47
  • oh, sorry :( i m good at command line git. – KOTIOS Jul 18 '14 at 10:48
  • @adcom I made a ZIP file, just to be safe. Will delete the local repo and clone it to the directory I want. If that fails, I will unzip it :D – An SO User Jul 18 '14 at 10:49
  • yup , you willing to use command line ? then u can guide to right path . the command line config needs very less time that all pulgins mess in eclipse – KOTIOS Jul 18 '14 at 10:49
  • @adcom I believe I need to switch to command line. I am learning that but just so I dont mess up my project, I stuck with GUI. Sure, point me in the right location. – An SO User Jul 18 '14 at 10:51
  • if u delete ur local repo via delete button and build ur project there may be chance to build ur project in older location so make sure u delete via git command – KOTIOS Jul 18 '14 at 10:51
  • @adcom Nope, it has the option to completely erase the files. Also, there was the option to import local repo into workspace. DANG! – An SO User Jul 18 '14 at 10:52
  • :) coppied my answer !!! , u would hv said me to post it :) i would hv made ur job more easy :P – KOTIOS Jul 18 '14 at 10:57
  • @adcom Have a look http://stackoverflow.com/questions/24823494/git-for-version-controlling-android-project – An SO User Jul 18 '14 at 11:04

1 Answers1

2

May be below command help someone to get rid of same issue with command line :

Step 1 : To make sure that ur git does not contains any local changes do :

git status

make sure here there is files where u have changes something and is in red color

Step 2: To check when and how commited last do :

git log 

Step 3 :

rm -rf .git

Make sure u just take backup.

Step 4 : do git clone to dir u need :

git clone ssh://firstname.lastname@xx.x.xx.xx:xxxxx/project_name
KOTIOS
  • 11,177
  • 3
  • 39
  • 66