How do I use Git LFS in Android Studio (Windows)? - android-studio

An included sqlite database shipped with my Android app is now larger than 100 MB, so GitHub (GH) rejects my push of the updated file via Android Studio's (AS) version control. I can't currently reduce this file below the 100 Mb limit and it's required for the app. I've installed Git-LFS and taken the following steps via AS Terminal:
git lfs install
git lfs track "*.db"
git lfs track "app/src/main/assets/*.db"
git add .gitattributes
When I try to push the updated database via AS, the push is rejected and the AS Console message is:
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File app/src/main/assets/frequency.db is 138.46 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
Local commits seem to work fine.
Before the database grew above 100 MB, commits and pushes to GH worked fine via AS, so I assume I have AS configured properly for version control using GH. Also, this means previous versions of the database (those below the 100 MB limit) are in my GitHub repository. I'd like to retain those versions in GH if possible.
Android Studio version: Artic Fox, 2020.3.1 patch 3 (Windows), with Git and GitHub bundled plugins enabled
How do I use Git-LFS in Android Studio? Is there a different git plug-in I should install? Is there a configuration/setting change I need to make in AS?
I've reviewed the following SO questions, but virtually none of them discuss using Git-LFS in AS:
Can't push to GitHub because of large file which I already deleted
git-lfs command not found webstorm
not able to push file more than 100mb to git hub
Files too large warning in Github Desktop after configuring Git LFS
Staged git lfs files not being intercepted by git-lfs
Git reports large file error despite using Git LFS
I've also reviewed the following, but there is no discussion of using Git-LFS in AS:
https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github
https://developer.android.com/studio/publish/versioning
https://developer.android.com/studio/intro#version_control_basics

Related

Extra file showing in android studio after cloning project

Since a month, I have been cloning the repo by copying link and pasting in my android studio and then I would checkout the "MySpace" branch and continue my work there. But now when I checkout that branch "repository" module gets automatically added there but it is not present in github after switching to that branch.
repository file showing in mySpace branch
repository file not present in GitHub MySpace branch
Repository file is present in master branch in both Github and android studio(that's not an error, that was added by team).
repository file present in master branch
repository file in master branch in android studio
This is the error I am getting in android studio after trying to run the mySpace branch
android studio error log

Deleted a repository in github but it still shows up in android studio? how do i remove it?

Initially, i have 2 repositories on git hub. I deleted one and kept the other.
https://imgur.com/a/9Mq1dim
However, android studio still thinks i have both of them.
https://imgur.com/a/wLBwhLZ
How can i fix this?
Thank you.
I think you still have all the repository remotes locally configured.
Try in the repo folder to see the remote repositories :
git remote -v
And delete the remote with :
git remote rm <remote-name>

Move android studio project to an already created Github Repository

I made an android studio project and I also have an empty Github repository already created where I am a contributor. How do I move my android studio project to this already created repository?
I tried but I am not able to achieve this.
Any ideas?
Thanks.
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.
I managed to solve the problem. Instead of moving the project using android studio to an existing Github repository, I did it locally using the command line. The steps I followed are here. Now its perfect and further commits can be now done directly from the android studio.

Android ndk library not push perfectly to the github

I'm working on a android studio project which has NDK library. I clone the project:
git clone https://github.com/Kitt-AI/snowboy.git
follow the instruction for making swig and after that I modify it little bit and I like to commit it to my own repository in GitHub.
but the problem is after I make a change to the project and try to commit it, it seems not all file committed completely because when I clone it from my repository it's give me this error
Error:Could not list contents of '/Users/xxxxx/test1/SnowboyAlexaDe/src/main/jniLibs'. Couldn't follow symbolic link.
any help would be appreciate.

Android Studio Git not updating Remote

I updated Android Studio to 2.2.2 and now my source files
are not being updated in the remote Git repository.However my .idea and .gradle folders are.
Why would this be?
How can I get the source files to be pushed as well?
I get this message at the bottom of Android Studio
Push successful Pushed 1 commit to master/t
t being by branch but twhen I check on Github on the web there are no changes.

Resources