How to connect existing Android Studio project to existing Github repository
I would view this thread if you want to create a new project.
How do you synchronise projects to GitHub with Android Studio?
If this doesn't help then I would just delete your current(local) project and import from github.
http://teamtreehouse.com/library/android-tools/git/pulling-down-github-projects-to-android-studio
I would recommend staying with command line. It is great practice. View link below for more information.
https://softwareengineering.stackexchange.com/questions/173297/why-learn-git-when-there-are-gui-apps-for-github
How to add an Android Studio project to GitHub
- Sign up and create a GitHub account in www.github.com.
- Download git from https://git-scm.com/downloads and install it in your system.
- Open the project in android studio and go to File -> Settings -> Version Control -> Git.
- Click on test button to test "path to Git executables". If successful message is shown everything is ok, else navigate to git.exe from where you installed git and test again.
- Go to File -> Settings -> Version Control -> GitHub. Enter your email and password used to create GitHub account and click on OK button.
- Then go to VCS -> Import into Version Control -> Share Project on GitHub. Enter Repository name, Description and click Share button.
- In the next window check all files inorder to add files for initial commit and click OK.
- Now the project will be uploaded to the GitHub repository and when uploading is finished we will get a message in android studio showing "Successfully shared project on GitHub". Click on the link provided in that message to go to GitHub repository.
Move android studio project to an already created Github Repository
The simplest way to do that is not to bring your project into an existing git repository, but to bring git to your project.
At the root of your project:
git init
git remote add origin <url>
, where<url>
is your GitHub repository's URL.git branch --set-upstream-to origin/master
to setup your default branch and remote.
how to push a existing android project to an organisation's repository?
Create a new repository under your organization's account, then add it as a new remote:
git remote add newRemote https://github.com/organization/repo.git
Then, push using this command:
git push newRemote master
If you wish to make the organization's repo the default repo, you must replace the remote called origin
:
git remote rm origin
git remote add origin https://github.com/organization/repo.git
You can list all currently configured remotes like so:
git remote -v
Add github project to existing Android Studio project
You have to add this:implementation 'com.github.hakobast:dropdown-textview:0.3.1'
to build.gradle(:app)
in the dependencies
selection
Replace GitHub repository with a new Android Studio project while preserving old commits
Rename your current project folder (the new one you want to put on GitHub) to something like
MyProjectBackup
.In Android Studio, go to File > New > Project from Version Control > Git. Then log in with your GitHub username and password and select your old project's repository name from the list of your GitHub repos. Continue through the import wizard and you should end up with your old project in Android Studio. (Now, for example, your old project is in
MyProject
and your new project is inMyProjectBackup
).Manually delete everything except for
.git
and.gitignore
(and maybe the readme and license) from yourMyProject
project folder. (I had triedgit rm -r *
but I was getting errors.)From the command line in your
MyProject
folder rungit add -u
git commit -m "deleting old files before adding updated project"This will update the tracked files in the working tree for all the manual deletions you just made.
Copy in all your new files from
MyProjectBackup
. Then rungit add .
git commit -m "new updated project"
git push
Now your new project will be in GitHub and the old project's commit history will still be available.
Helpful reading
- Git Basics - Recording Changes to the Repository
Related Topics
Detect or Prevent If User Uses Fake Location
How to Set Space Between Listview Items in Android
React Native | Failed to Install the App. Please Accept All Necessary Sdk Licenses Using Sdk Manager
Remove Apk from Library in Google Play Developer Console
Android: How to Open a Specific Folder Via Intent and Show Its Content in a File Browser
Cart Item Count Increment/Decrement & Add to Cart
How to Get Minutes Difference Between Two Time in Android
Notification Disappears After Showing
How to Resolve Javax.Xml.Bind.Jaxbcontext in Eclipse
How to Display an Image in Full Screen on Click in the Imageview
How to Fix Mainactivity Does Not Have a Navcontroller
Error Androidmanifest.Xml Doesn't Exist or Has Incorrect Root Tag
Remove Old Fragment from Fragment Manager
How to Make a Link Open an Instagram Page in an App Installed on Android
Android Studio - Xml Editor Autocomplete Not Working With Support Libraries
How to Get the Currently Displayed Fragment