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
Related
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.
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.
Enabling the version control and connecting it to the user account in android studio creates new repository on github for each project and pushes the project to it by default. However, I would like to know if there is a way to setup Android Studio to upload the project to specific folder in already existing repository on github?
As mentioned in the comments, you have to move all your files to that specific folder and commit & push that folder.
You can not commit & push files into something, that is not the idea behind Git. It's mostely about Version Control
First install git-bash (i won't go through the installation) if not installed.
Clone the project on your pc.
git clone repo-url
Now create the required folder (and add files which you want in that folder) inside the repository you cloned on your pc.
git add .
git commit -m "Message"
git push origin master
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
How do I take my existing project in Eclipse on Windows for Android and put it inside a branch on a repository for Git? I also want to share this repository with my friend to help code. He already set up a Git repository and sent me the address and credentials. I just don't know how to go about this?
Once I get a cmd line for Git on Windows what do I have to do to add/clone this project to my friends repo or my own (then how do I share my repo with him?). I use Git with GitHub in Ubuntu (I didn't set it up) but I don't really know how to set this up.
I've already installed a plug-in egit and have had issues with that. I would like to use a separate interface from Eclipse for Git now.
Bones of the Question: How do I get my existing Android project into a Git repository that IS NOT a plug in to Eclipse?
Download msysgit from http://code.google.com/p/msysgit/
Download TortiseGit https://tortoisegit.org/. If you're using private keys, make sure you select Plink instead of openssh. I've had problems with OpenSSH for Windows.
Add your private key, if you're using it, to Pageant (included with Tortise Git).
Clone your repository with Tortise Git.
Copy all your files into the new directory.
In the Tortise Git context menu, select Add.
Select All
Commit
Push
That would be the short instructions.
Also, if you're comfortable with the command line tools, msysgit includes Git Bash, which is kinda like using Git in Linux.
http://nathanj.github.com/gitguide/tour.html this is a nice tutorial on a gui version of git. in your case you would do a git clone from the existing url that your project is stored in or create a new repository if you havent set one up on github yet.