I am new to GIT. I have a manifest file that contains group of related projects. I installed eGIT eclipse plugin to clone the projects. I am able to clone projects one by one in the manifest file. But I want all the projects in my manifest file to by clone at a single time for a specific branch.
Manifest file
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="ssh://xyz.com:29418/" name="origin" review="xyz.com:8081"/>
<default remote="origin" revision="refs/heads/evo_main" sync-j="4"/>
<project groups="common" name="ACT.git" path="code/ACT"/>
<project groups="common" name="AppEngine.git" path="code/AppEngine"/>
.
.
.
.
</manifest>
I am able to clone a single project with the url
ssh://user#xyz.com:29418/ACT.git
But since there are lot of projects I need a way to download all in a single clone. I dont want to use GitBash or any other command line tools. I want to achieve this eclipse plugins. Please help!
You will have to write script that does it for you or to use external program like
mr
The above mr is a software that know how to handle sereveral repository types.
If you dont use anything like that you will have to write script that does something like:
- run on every folder in a given path (or give it a list of paths)
- verify that each folder is a git repository (has .git folder inside)
- execute your git command (like git fetch --all --prune or git pull ...)
Related
I want add a patch for android source code.
Have downloaded the code after the instruction from:
https://source.android.com/source/downloading.html
After that i follow the steps in:
http://source.android.com/source/submit-patches.html
When i should start a new repo branch:
repo start NAME .
I get error:
error: project . not found
Can someone tell me why?
This error will occur if you try to run the command repo start NAME . inside the WORKING_DIRECTORY folder. This is because the WORKING_DIRECTORY folder is not a git repository. You need to go to some inner folder in which there is a git repository you need. Inside the folder, that is the git repository, or in one of its parent folders, there must be a .git folder. For example, go to this folder: /frameworks/base/core/java/android/widget. Inside this folder, run the command repo start NAME .
I was wondering whether it is possible to clone a subdirectory of a repository off GitHub using Android Studio? Usually when you clone a repository, you go "Check out project from Version Control" --> GitHub --> then you get something like this
However, for example, I would like to clone this subrepository as I would like to build the project and put it in my emulator. This address is https://github.com/hmkcode/Android/tree/master/android-material-design-appcompat.
I have tried to guess https://github.com/hmkcode/Android.git might have becomehttps://github.com/hmkcode/Android/android-material-design-appcompat.git, but this did not work.
Is it possible to clone this subrepository as I dont want the rest of the repository. I dont want to have to clone the whole thing and try to piece together the sub project.
This is not a "subrepo": it is just a subdirectory, and git reasons at the repo level.
You could use sparse checkout though, but it is not supported directly by Android studio. You would have to prepare your local repo:
mkdir hacker-scripts
cd hacker-scripts
git init .
git config core.sparseCheckout true
echo 'android-material-design-appcompat/' > .git/info/sparse-checkout
git remote add -f origin https://...
git pull origin master
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
I'm using repo to build Android. I want to build from a previous release (e.g. build #1234 from last month). I do something like this:
I start with a special copy of the manifest that explicitly sets the revision for each package:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
...
<project name="packages/apps/Browser" revision="f42301ffb36a68fadffdb87fa1bdc09aceac53cb"/>
<project name="packages/apps/Calculator" revision="481a23ed78397e35201de3638ec0d76797b77d25"/>
<project name="packages/apps/Calendar" revision="19a0737be4d51aa71a0d122f5f24ab7e53869398"/>
<project name="packages/apps/Camera" revision="67e6c190f82f0f7b8704fe5663eb92082c4cc943"/>
...
</manifest>
This is basically a copy of default.xml, but with the revision for each package specified explicitly for the commit that was in place when build #1234 was created.
So now I give the commands
cp ~/manifest-build-1234.xml .repo/manifests
repo init -m manifest-build-1234.xml
repo sync
The result: Some of the packages are set to the revision specified in the manifest, but some of the others remain at the previous head.
If I delete those packages entirely, and then do another repo sync, then the packages are checked out at the correct revision.
So my question is: short of just deleting everything before I do the repo sync, how can I guarantee that all packages are checked out at the correct revision?
Use --trace with repo command to check what steps get executed while running repo commands. e.g "repo --trace sync -j4"
I'm new to Git and Github and I'm trying to figure out how to push to the root directory on Github from Eclipse (Windows).
I have created a Github project called MyProject. MyProject is an Android project with the usual Android directory structure:
MyProject
src (+ res, assets, etc)
From Eclipse I push my Android project called MyGame to MyProject. MyProject now becomes a sub-directory to MyGame, so that the readme file in MyProject isn't visible unless the user first clicks on MyProject on Github to drill down one level in the directory hierarchy.
How can I push MyGame so that its contents (src folder, res folder, readme) become visible at the root level in the Github project.
Update: I tried using command line:
git remote add origin git#github.com:username/reponame.git
git push origin master
This has the same result, on Github the directory hierarchy is:
MyProject
MyGame
src
How can I make it
MyProject
src
?
I believe your problem may be that your git repo in Eclipse is in the parent folder of the project. What you need is for your git repo to be in the project folder.
Now, Eclipse seems to recommend that Git repos be set up in the parent folder of their projects. I am guessing that this is so that later related projects that may be needed can be easily added to the git repo. If you're not worried about that, and just want it to work as you described, see below.
Note that I'm running Ubuntu Linux, and so my Eclipse and desktop will probably look different from yours.
First we're going to find out if my guess as to the problem is correct:
Open the "Git Repository Exploring" perspective in Eclipse.
Look at the "Git Repositories" view. See if the path given for your repository is pointing to the folder containing your project. If it is, continue with the instructions below.
If your repo is in the folder above your project, then the problem shapes up like this: Git will recreate all the paths in your repo relative to the repository itself when you push it to GitHub. If it is in the folder above your project, then all the paths will include the folder containing your project. So, you'll need to move your repo into the folder containing your project. I'll describe the steps to achieve that below.
To begin, you'll want to make sure you don't have any uncommitted changes, or any stashed changes (if you don't know what stashed changes are, don't worry about them).
As a matter of caution, you may want to create a complete copy of your current code & repository at this point if it's at all important.
Open Windows Explorer and navigate to the folder containing your git repo, per the path given in the "Git Repositories" view.
At this point, you may want to close Eclipse, to avoid changes startling it (they shouldn't, but "you never can tell with bees!")
If you can see a .git folder in Windows Explorer, then go on to the next step. If not, you'll need to show hidden files. http://windows.microsoft.com/en-US/windows7/show-hidden-files gives instructions for Win7.
Now you should be able to see a .git folder. Copy this into your project folder.
Start Eclipse (if you closed it) and open the "Git Repositories" view again.
Click the button to add an existing local git repository. Choose the project folder.
Go back to the normal Eclipse Java perspective. Right-click your project and choose Team > Disconnect to temporarily stop heeding the old repository.
Right-click on the project again and choose Team > Share Project.... When prompted for a repository, check the box to use the one in the project/parent folder. In the view below, check the box of the one which is directly within the project folder (it will probably have one dot next to a folder.) Then click the Finish button.
Now you'll probably have a lot of catching up to do. Git will believe that you have deleted every file in your project and replaced it with a file with one less layer of directory path. You'll need to commit all those changes to get a clean repo.
Push the changes from step ten to GitHub. Check that it looks as you expect.
I hope this helps. Please comment if something's unclear or there's another issue. Please make sure to have a backup before you try this... I've not tested it entirely, and I don't want to cause any unneeded grief.