Issue
my friend have create a project on gitlab, when i signin gitlab i view project xxxxx/project if i click on it, i enter in project and i can select link ssh or httsp. For example link https://gitlab.com/xxxxx/myproject.git If i click link repository: https://gitlab.com/xxxxx/myproject/tree/master there are three directory: client/myprojecty, server/myserverproject, sketch/mysketchserver
Project android is in client/myprojecty, now i want connect my local project that is located into C://User/AndroiStudioProject/myproject with client/project and i want use android studio.
I don't want that client/myproject overwrite my local project C://User/AndroidStudio/myproject
How do i with android studio?
I have try when starup android studio: Check out project from Version Control then i click git Then open dialg Clone Repository where there is text field to fill:
Git Reposiroy Url: https://gitlab.com/xxxxx/myproject.git Parent Directory: C://User/AndroiStudioProject/myproject Directory Name: myproject
I have not clicked clone because i'm scared that this command overwrite my local project and delete all progress in my local project.
How i do only connect my local project with project on gitlab? Then how i update my progress?
Solution
First of all make a copy of your project folder (do it always when doing these kind of things just in case)
Then open your project and go terminal tab in android studio and type
git init
Now your local project is controlled by git. But how to connect it to your remote project is like below:
git remote add origin [the address of your remote repo]
Then just type:
git add .
And commit your changes like below:
git commit -m "first commit"
Then type this to push on server:
git push -u origin master
Answered By - Amir Ziarati
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.