Change the repo initialized folder - android

I would like the repo to sync the source code to "~/home/username/android/device/" folder
currently the repo sync checks out to "~/home/username/" folder
I have tried to initialize the repo to /android/device folder twice and then synced it again, however it didn't work.
Any suggestions?

Did you try to use git remote set-url? If not, you may find helpful this article: https://help.github.com/articles/changing-a-remote-s-url

Related

GitHub connecting to an existing project with Android Studio

I want to create a repository which my coworker will push his project files into it. When we tried this he did not know how to do it without firstly pulling the existing files which I was created before. But we don't want them. How can he replace his project files over my existing repository files?
It is possible and you can do it like this:
First configure AS so that you share the same repository
Then:
and finally
In order to replace your files you are working on simply synchronize and commit files!
You (or your coworker) will have to manually remove the files (then commit and push the removals) you don't want. You can do the removal before your coworker clones the repository.

Android-Studio: Github --credentials get: GitHub: command not found

I was trying to upload my project to GitHub on Android-Studio.
Pushing to GitHub master... process never ends and Version Control Console gives this Error:
GitHub --credentials get: github: command not found
'C:\Users\SA'EED~1\AppData\Local\Temp\git-askpass-2722525787662236837.bat" "Username'
is not recognized as an internal or external command, operable program or batch file.
I only find an empty repository on my GitHub.
Assuming that you have the latest version of GitHub, check your git path.
Settings->version Control -> Path to git-executable
It should be something like -> C:\Program Files (x86)\Git\cmd\git.exe
Note this may vary upon where you have installed GitHub.
Try
Test
It should be a success. Try to push your code again.
If this does not work try solution 2
Solution 2:
Simply make a copy of your project(copy and paste) in some other location. Delete the .git physically from the new copy. Import the new copy into android studio again. Go to version control System(VCS)->Import into Version Control->Share project on github or bitbucket(whichever you have set up). Then enter master password and new repository name. Then your setup is complete and push your code.
You might find the answer you're looking for in this post: http://jrxie.blogspot.de/2014/02/github-credentials-get-github-command.html
tl;dr: you want to add your equivalent of the following folder to your PATH.
C:\Users\YOUR_USER_NAME\AppData\Local\Apps\2.0\LNKHAB6L.QR1\LP7D7JB2.E6Z\gith..tion_317444273a93ac29_0003.0000_c74cce3a838f9354
The folders inside Apps\2.0 are probably named differently, but you shouldn't have any problems finding the right ones.

What does repo init and repo sync actually do?

I posted this question at Android Enthusiasts but figured it was the wrong place to ask, so I deleted it from there and asking it "again" here.
This is such a noob question, and pardon me if it is, but I just want to understand the underlying concepts clearly. Reading repo help and Google's repo command reference page doesn't really enlighten much. I understood some bits from Google's reference page, but I still need some more clarifications.
Following the instructions on how to download android source, I executed these two commands on an Ubuntu shell: (I've taken cared of all the prerequisites for the environment.)
~/android4.2.2$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.2.2_r1.2
~/android4.2.2$ repo sync -j4
After waiting half a day for repo to finish downloading, I ended up with 19G of downloaded material in android4.2.2 directory. So what exactly just happened, and why did it reach 19G when Google said I should only be expecting around 8G of source files?
repo is a python wrapper script for git, its Google Source page defines it as
repo - The Multiple Git Repository Tool
repo init command initializes repo in the current directory. That's, it downloads the latest repo source and a manifest.xml file that describes the directory structure of the git repositories, and store all of these in .repo sub-directory in the current directory. In your case, you have used an optional -b argument which is used to select the branch to checkout. By default (i.e., when -b argument is not used), master branch is used.
repo sync updates working tree to the latest revision. That's, it synchronizes local project directories with the remote repositories specified in the manifest file. If a local
project does not yet exist, it will clone a new local directory from the remote repository and set up tracking branches as specified in the manifest. If the local project already exists, it will update the remote branches and rebase any new local changes on top of the new remote changes. -j argument is used to set number of parallel jobs to execute. The default value can be defined in the manifest, and also can be overridden in command line as in your case.
why did it reach 19G when Google said I should only be expecting around 8G of source files?
That should be because besides the source files, you will get all the history of Android since the beginning of the time :)
Hope this helps.

eGit move project to a different location?

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?
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

How to use git with android libraries?

Like most android developers I use eclipse. When you set up a Android Library Project it is created in it's own directory.
Example:
/workspace/
/workspace/libproject1
/workspace/libproject2
/workspace/myapp
/workspace/mysecondapp
Now myapp will have a project.properties file that will have this:
android.library.reference.1=../libproject1
android.library.reference.2=../libproject2
And mysecondapp might have a project.properties file with this:
android.library.reference.1=../libproject2
How does this work with git? I check in libproject1 and libproject2 in there own repos. However if I use git submodules to connect the library project into myapp it wants to put them in a sub-directory. Then the project.properties files point to the wrong location. Is there a simple solution to this?
Git has nothing to do with the setups unless you use them as sub-modules. I have been having the library projects in separate repos, and each time someone has to clone them, they should be cloning them into a common workspace folder. And it should work.
android.library.reference.1=../libproject2
This means, that Eclipse would try to find your library project in the parent folder. If it finds it there, everything else if fine. If not, you will need to manually tell eclipse where to find it if you clone the library in another location.
Personally, I would not prefer using sub-modules. I haven't tried though.

Categories

Resources