I have created a Git Repository on bitbucket. The repository is empty now. I have an Eclipse project, in my system, that I want to push(using Eclipse - EGit) into the repository I created. How do I do it?
I have no knowledge of doing this by command line, so, please, give me the details for doing this by using the GUI of Eclipse. Any links that might help, also are appreciated.
First, make sure you already installed EGit or other git control plugins on your Eclipse.
Second, add Git Source Control to your existing Android Eclipse Project (local) and create a local Git Repository for the Project, by following the steps below: (or check this video)
right click your project -> Team -> share project
check the option of "Use or create repository in parent folder of project"
select your project
click the button of "create repository"
hit "finish"
right click your project -> Team -> Add to Index
right click your project -> Team -> commit
Then push your Project (now is under local Git Source Control) to a Remote Repository such as GitHub.com or BitBucket.org, by following the steps below: (or check this video)
right click your project -> Team -> remote -> push
type in the URL of the remote repository you are using
type in username and password, then hit "next"
click the button of "Add All Branches Spec"
click "next"
click "finish"
Okie.. So I figured it out.
Steps :
First, create a new workspace.
Open that workspace in eclipse.
Go to New->Other->Git->Git Repository
Browse to the Workspace, you just created. Follow the steps in dialog and finish it.
Copy, your existing code, (src, res, etc.,) into the project folder.
Import the project into workspace, File->Import->General->Existing projects into workspace.
Once the application builds, you will have NO HEAD beside the project.
Right click on the project folder, Go to Team->Commit
Enter Commit Message and do Commit And Push. This will take you to screen that asks for URI in bitbucket.
Copy the clone path from bitbucket and paste in the URI path and complete the steps in the dialog. (If you get to a screen asking for Add Specs headers or similar, select the master for Add/Update header and click on button that says Add all specs and finish it.)
Thats it.
Note ::: I am not yet that comfortable with Git, so, probably, the steps may or may not be the correct way or the easiest way to do it. But, that said, these steps worked for me. They might work for you too.
Hope this helps..
Create a git project in eclipse by cloning it from a repository link.
Then open a project location on your drive. Usually C:/Users/yourname/projectname. If you don't know where it is, it says under a working tree in eclipse.
Copy your files/folders there and refresh the project in eclipse.
Related
So when I try to share my project with GitHub through Android Studio, it says I have done it successfully, and a new repository is created, but when I open the repository, it is empty. I'm pretty inexperienced with GitHub, and I have spent hours trying different things and I can't get it to work, so if someone could help point me in the right direction, I would be extremely appreciative.
Here are the steps for seamlessly working with Android Studio and github
Create a new project in Android Studio.
Create some files.
Go to VCS -> Enable Version Control Integration. Select git
Go to VCS -> Commit File and select all the files that you want to commit with a message.
Go to VCS -> Push.
Click on Define Remote.
Enter the url for the already created repository in github.
Click Push and enter the Github password.
P.S : I am using Android Studio version 1.5 If you are using some other version, then the steps can be a little different.
After creating Repository, you have to push/commit the source files to the server. It seems you have not committed any file yet.
You can use some other Git clients like Source Tree with GitHub
I have a project made in Android Studio that I wish to put into a GitHub repository. I used "Import into version control" -> "Share project on GitHub". Android Studio then made an empty repository on my GitHub account with the name that I specified. I simply cannot make an initial commit now that the repository is there. When I use VCS -> Git -> Commit file, it simply pops up a window that says "Nothing to commit.". I've tried making a new dummy file, and yet it still thinks there have been no changes. I've also tried selecting all of the files and using the "add" button, but this appears to do nothing whatsoever. How can I get this project on GitHub? My desire, specifically, is literally just to somehow commit my project in Android Studio into this GitHub repository it has created for me so that I can collaborate on this project with some friends. Thanks in advance.
If there is nothing to commit, Android Studio has already commited all your files locally. Now you need to VCS > Git > Push to upload your commits to your GitHub repository.
What ended up happening is I just created a new project, copied and pasted all of my code in, and then used the "Share Project on GitHub" button again. This time, for whatever reason, it worked seamlessly.
I am new to working with repositories.
I'm forced to work with my team on academic project using git. My job is to write Android app.
The problem is when I wrote it, then pushed it to repo I want to pull it on different machine.
But when I pull it, I get only "source" files, no: (for example) R.java.
Moreover: I wanted to use "Clean project" Option, but it seems, that my Eclipse is not treating the pulled files as project (when I click "Clean..." I can choose any project in my workspace, but the download one is lacking).
Anyone could help me?
EDIT:
I've solved the problem:
Git doesn't push to repository automatic-generated files, like R.java. After you pull it back, you have to Clear project and rebuilt it. If it still doesn't work: try restarting Eclipse
I am stuck here and in extreme need to expert advise
I have created an Android project in Eclipse and was in the process of creating a git repository for it using EGit.
I have gone through the normal process of creating a repo in Eclipse: right-click project -> Team -> Share Project
I gave the repo a name and hit continue to create it.
The progress bar started flashing but in the middle i got a problem creating the repo. I do not remember what the issue was but i decided to delete that repo and start from scratch.
So i went to Git Repositories in Eclipse and hit delete repo. I checked the box that says delete existing files in the repo. And unfortunately, the whole Android project was deleted from Eclipse :(
i was not aware that by creating a repo the original files will be copied over to the repo folder and removed from the workspace :'(
Does any one know an approach to recover that deleted repo/project?
Many thanks
I had the same problem, deleted project so there is no "Recover from local history" button to click, and no local windows history, but you can do a manual recover from history.
I tried this solution in Eclipse Oxygen/Windows 10,
First of all, eclipse store history file at here,
(workspace)/.metadata/.plugins/org.eclipse.core.resources/.history/
and there is a lot of file with long name like this '006de3225c86001811b7ff2e93138537', that's the history file eclipse using to recover, you can search the text inside those file for the package name of the deleted project, then you can pick the latest one, copy past it to the new project location, renaming them to the correct file name. This approach is complex, but works for me.
In eclipse there is an option for projects. Right of project and see : "Recover from local history". This should help you
If you deleted your git repository permanently and it is showing that there is no project or file on eclipse window .
Then go to your current workspace of eclipse and search these file name there, you got all of your file there and you can see every folder and files of that project.
The workspace of eclipse is in C:/User/name/workspace/current_workspace_name/project_name
I just used Eclipse and Egit in order to make my first open source project.
This was working pretty well and I made some commits and push during a few weeks.
Now, I have my Android project in my git folder (localy) with some unpushed commits.
Due to some bad manipulations, I removed my project from Eclipse, and I would like to import ir again and push the commits I made.
First thing I tried was to "import" an existing project and pointed the folder of my application, that worked but I lost all my "team" tab and cannot push again.
all the git informations are not linked. (no commits, no push,...)
I also tried to start a new project and choose "from existing source" but with the same result.
Thank a lot for any help.
I will answer myself.
I had to right click on the project, select team, then share.
At this place I had to fill with Github repository, was not so intuitive, but I did it.