Export Android Studio project to Gitlab


#1

Hi,
I’m new to Gitlab and I didn’t anything related to my issue so here I am :slight_smile:
I’m working on an Android Studio project and I’d like to export it to Gitlab instead of Github.

I didn’t find any topic to know how to export it and to push commits.

Can someone help me?
Thank you.


#2

If android studio supports Git, you can use that. I guess it will use HTTPS with your username+password instead of a token-based option like GItHub has.


#3

OK, I’ll try later.
I’m used to building my app locally and I don’t feel comfortable with pushing commits and updating my repo.


#4

Hello,

This should just be 3 easy steps.

  1. Create the project in Gitlab and using the import from github button (below with arrow)

  2. Once the project is imported, use Android Studio’s “Checkout from Git” option.

  3. You’ll then get this prompt, replace it with your repo URL from the gitlab project your created in step 1.

It should then create your project and you’ll be able to work and push just like you did with GitHub.

Hope that helps,

-Tyler Rockwood


#5

Thanks a lot! Really appreciated.
Could you also tell me how to push / merge commits after switching to Gitlab?
As I said, I only managed my Android Studio projects locally and I didn’t find guides to push/merge commits through Github either. I only found the way to export a project to Github.


#6

It will be the same process as Github. It’s just another Git repo. Here’s a couple tips on doing it in Android Studio:

  1. You need to enable Git operations under the VCS menu (First option)

  1. You’ll then get this popup, choose ‘Git’

  1. After that, visiting VCS will give you a list of options, you can add, commit merge, push, pull and everything you need.


#7

Now I have my project on GitLab.
For testing purpose, I added a new folder in my project in Android Studio.
Could you explain me how to push/merge this change into GitLab?
In addition, can we upload apks? As I saw on Github: "project/releases/
Thanks!

EDIT: gotcha
Right click on the project in AS > Git > Commit directory


#8

Or use this plugin?
https://plugins.jetbrains.com/plugin/7975-gitlab-projects