Importing Android Studio Project into GitHub - android

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.

Related

Error with sharing Android Studio project with GitHub

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

Bitbucket plugin can't connect in Android Studio

I recently downloaded the Bitbucket plugin for Android Studio (I'm running 1.1.0). Initially, I downloaded it from this link (https://plugins.jetbrains.com/plugin/6207?pr=phpStorm) which should be compatible with Android studio.
When I tried to clone a project in my repo, it prompted me for login credentials. I entered them, but it tells me that I can't connect to bitbucket. Then I installed the plugin from the plugin settings page seen here
I made sure that the plugin was enabled. I'm thinking this is an issue that has to do with proxy settings (I'm currently on my college campuses network, but I can connect to other VCS services like Git without problems so I doubt that's the problem).
Any suggestions?
EDIT:
Going into Bitbucket's settings and testing it shows this:
Had the same problem some time ago. Though I have not yet upgraded to 1.1, I found this implementation to work with previous version:
https://bitbucket.org/dmitry_cherkas/jetbrains-bitbucket-connector/downloads
It seems the "official" one is outdated and this one is working fine.
Please, let me know if this does work for you.
Regards
Jose
you don't really need bitbucket plugin.
Push your project to bitbucket
create a new repo in bitbucket
click on "I have an existing project" in bitbucket repo
execute these commands in Android studio Terminal to push your project to bitbucket
Checkout from Bitbucket
you can also checkout bitbucket projects giving bitbucket URL in "Checkout from GitHub" option in Android Studio
If you are still having problems (like I was recently) even though you've tried the plugin and you feel uncomfortable or not knowledgeable about initializing git for your project by hand via terminal you can use SourceTree. You will have no problems with BitBucket using source tree since both are made by Atlassian.
Once you've installed SourceTree and walked through the first boot setup process giving SourceTree your credentials you click Clone/New and a dialog will pop up. There will be the normal browse button and also a button button that looks like a globe allowing you to browse the hosted projects linked to your BitBucket account. You can also copy an paste the link from the project home on bitbucket as well. Once you've chosen the repo you want to clone, pick the destination folder and if you want to bookmark the project or not and press "clone".
Once clowning is complete you should hit the pull button to pull down the latest changes picking the appropriate branch you want to pull from. When pulling is complete you should have all the files that's on the head of that branch (master if not specified) which in most cases is an android project.
Open Android Studio and choose File->Open and browse to the folder you just pulled data to and that open the android project. Once that is done and the project is open make sure you go to VCS and you should not see "Enable Version Control Integration". If you see this that means android studio does not see the .git folder hidden in the project root (or something in that ball park....maybe it's really not in the project root). If you see git commit and git pull options then you are now using version control and bitbucket as your remote repo. Make a change to a file and you should see it turn blue specifying that changes have been made but not committed.
For more info on version control in android studio see this video https://youtu.be/Ldmc757EXaE?t=6m47s and the documentation on the intellij website.

Recover Deleted Git Repository from 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

Bitbucket - Push project files to an empty Git repository

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.

I deleted my git project from Eclipse, how can I open it again and sync?

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.

Categories

Resources