Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio How to push to new Repository

Hi I have recently made a project in android studio and just want to push it to a repository. I've pulled before but never pushed a brand new one and haven't found a good tutorial as to do so. Whenever I push it will make a Repository folder on Github or Bitbucket but never push any files.

like image 209
Ryan Avatar asked Feb 03 '15 06:02

Ryan


People also ask

How do I push code to another repository?

To push the commit from the local repo to your remote repositories, run git push -u remote-name branch-name where remote-name is the nickname the local repo uses for the remote repositories and branch-name is the name of the branch to push to the repository. You only have to use the -u option the first time you push.

How do I push a project in Android Studio?

Make Changes to Your Files You can also click "Commit" and push your files later on. To push your files, click "push" in the top right corner. You can also go to menu "Git→Push".


1 Answers

1)Create a repository in bitbucket/github.

2)You would get a link like https://blah [email protected]/.../....git

3)Now create the project in Android Studio.On the top menu, select VCS > Import into Version Control > Create Git Repository.

4)After creating it open terminal inside the Studio itself and add a origin u want to push using the following git command git remote add origin https://blah [email protected]/.../....git

5)NOw, right click your projects root directory and select Git > Add. This will add all your project files to your Git repository.After adding right click the project name again and this time select Git > Commit Directory.After entering the commit message then finally commit

6)Then finally push it by selecting Git > Repository > Push.

like image 73
williamj949 Avatar answered Sep 23 '22 14:09

williamj949