How do I upload my android studio project to github - android

I am a newbie on github and am not familiar with it's ins and outs
I know how to locally create a repository on github,but I have no idea about converting my android studio project to a github repository
Screenshot of my project:-Image1

Follow these steps:
1- create a Github repository
2- open terminal in the project location
3- git init
4- git remote add origin <url of created repository>
5- dit add .
6- git commit -m 'initial commit'
7- git push origin master
you will see your project in the Github repo you just created.
Note You may need to set your credentials for the Github on your local git and create .gitignore file.

Related

how connect myProject to mainProject on github (Android Studio)

in the past, I did not download the telegram source with the git but now i need update my source and I need connect myProject (my Unofficial Telegram), to mainProject (Telegram) on github. my IDE is Android Studio. git in Android Studio is in VCS menu. but I do not know what to do, for conect my project to github project.
Make sure you have git installed on your system. If not, go to this link and download it
https://git-scm.com/download/win
Right click inside your local project folder and select 'Git Bash Here'
(If you want to clone your entire GitHub project into your local project, do it by typing:
git clone https://github.com/DrKLO/Telegram.git
If you already have the files and you just want to update it, skip this cloning step)
Check if your project folder has .git folder in it. (Check the hidden folders too) If there isn't one, type the following in your GitBash window
git init
Add the link to your GitHub (remote origin) by typing
git remote add origin https://github.com/DrKLO/Telegram.git
Update your files with the GitHub source by typing
git pull origin master
If you just want to know how to connect your project in Android Studio to GitHub, here's a simple tutorial:
https://www.londonappdeveloper.com/how-to-use-git-hub-with-android-studio/
(Skip the steps where he creates a new GitHub repository and an Android Studio project, since you already have both)
For detailed understanding on using git and github, i suggest you take this course:
https://in.udacity.com/course/how-to-use-git-and-github--ud775

Create android studio project from ssh Git (bitbucket) link

I was given a ssh link to a bitbucket repo so I can work on the project. The link someone gave me was something like ssh://git#bitbucket.CompanyName.tools/sp/company-project.git.
How would I create an android studio project, linked to this repo, to work on this project and view the files? I have never worked with git so this is all new.
I do not see the repo in my main bitbucket account if it makes any difference or not
Create clone of the given repo by entering below command in your terminal :
git clone ssh://git#bitbucket.CompanyName.tools/sp/company-project.git
After cloning checkout to new branch by :
git checkout -b newBranchName
Last step, go in your Android Studio, and Import the folder where you have clone the given repo.
In Android Studio go to:
File->New->Project from Version Control->Git
then in the dialog enter the link provided in your question ssh://git#bitbucket.CompanyName.tools/sp/company-project.git
File>New>Project From Version Control>Git is what you need

How to copy Android Studio project to remote Git (NOT GitHub) server

I can't find instructions for how to copy an Android Studio project from my Mac to a remote Git (NOT GitHub) server.
This doesn't seem like it should be hard but I have searched for hours and can't find anything specific.
A step-by-step guide would be wonderful.
The steps below works for any Jetbrains based platforms like Intellij IDEA, Android studio, PHPStorm, etc. It also works for any git platform (including GitHub)
You can use the following steps to push your code to a remote Git repository:
Goto VCS in the menu bar.
select "Enable version control integration."
choose "Git"(not GitHub) and press ok.
Then you can see a Version control tab near android monitor.
Open version control tab, go to local changes, and add all unversioned files to VCS. (Either right click on unversioned files and click add all, or click browse, select all, and click plus sign to add all to VCS)
Commit changes (Ctrl+K)
Push changes. (Ctrl+Shift+K)
define remote URL
enter username and password.
click on push.
To copy android studio project to a remote repo, you just need to follow below few steps (for your situation):
If the android project already managed in a local git repo
In Android studio Terminal windows, use below commands:
git remote add upstream <URL for the remote repo> -f
git push upstream master
If the android project is not manage in git repo for now, you can use below steps:
In the root directory of your project, execute the following commands,
git init
git remote add origin <URL for the remote repo> -f
touch .gitignore
#Add the (pattern of) files you do not want to traced by git, as https://github.com/github/gitignore/blob/master/Android.gitignore
git add .
git commit -m 'add .gitignore'
git push origin master
Note: If the remote git repo is not empty, you can clone the remote repo locally and then copy your project in it. Then commit and push.

How to push an existing Android project to GitHub repo using .gitignore file?

I am developing my Android app on Eclipse. It works fine and run properly. But, I want to migrate to Android-Studio. Here is what I am doing:
Create a repo in GitHub with .gitignore, a README.md and LICENSE files
From within my project folder run the following commands:
git init
git add .
git pull git-url master
git init (again)
git add . (again)
git commit -m "First commit"
git remote add origin git-url
git push -u origin master
From Android-Studio, I checkout the project from Git
Run the app from Android-Studio (after alot of configrations)
My concern is that ALL my project files and folders are pushed to the remote repo at GitHub, including for example: bin\ and .settings\ folders. Meanwhile, I only need to push the important and platform independenet files because I work in both windows/mac systems and in differnet locations (hence, this is the reason behind using version-control).
My questions are:
How to pull the files on GitHub first, and then use .gitignore to push the "important and platform independenet" files from my project folder into GiHub
What is the recommended method to export a project from Eclipse to Android-Studio while using GitHub ?! should I:
checkout the project from Git (as I am doing now) ?
use Eclipse Export Tool ?
or clone the project first into a directoty and then loaded into Android-Studio as an existing project ?
You can pull your files by git pull origin master command from GitHub.
Add the name of the directory/file in .gitignore file you don't want to push. see more
You can clone the project first into a directory then load it in Android-Studio.

Add an Android Studio / IntelliJ project to a code.google.com project with git

So, I have an Android Studio (IntelliJ) project for an app I'm writing. I'd like to add it to a project I've created on code.google.com. How do I do that without having to clone the repository to a new project directory and then push all my AS project files into it?
I see that I can almost do this with VCS > Checkout from Version Control > Git and specify a Git repository URL, but AS forces me to create a new, empty directory when I do this.
How do I setup Git source control with code.google.com as my remote repository, without having to move my existing project files around in the file system?
OK, so the best solution I've come up with is to create a local git repository, create a code.google.com git project, and then manually connect the local repository to the code.google.com project. Note that this requires git to be installed on your development machine.
Create the app project in Android Studio.
Select the root project folder.
Select VCS > Import into Version Control > Create Git Repository
Select project folder to create a git repository.
Now the project is under source control.
Create a project at code.google.com using git source control.
Go to the Source > Checkout page of the project and get the clone URL.
Open a terminal and navigate to the project directory.
Modify the local git repository to connect the remote repository on code.google.com:
git remote add origin https://my-user-name%40code.google.com/p/my-project-name/
Add files to the repository and commit them using the Android Studio interface or the git command-line interface, e.g.;
git add files-for-source-control.ext
git commit .
Finally, push the commit to the remote server:
git push origin master
#ObAt,
If you find Nothing to push message on Android studio, Try this method
Got to
VCS > Git > Push
and Select the tick box for "Push Current Branch to Alternative branch" and click Push button

Categories

Resources