简体   繁体   中英

How can I push a local android studio project to gitlab in an existing folder in the master branch?

I have 3 local projects on my computer project1, project2 and project3

In gitlab I have an existing repository. There is the master branch in this are 3 existing folders: project1, project2 and project3

How can I push the contents/project of my local project folders into the respective matching project folder in the master branch?

So that the contents from the local folder project 1 are also in the same folder project 1 in the repository. And so on.

I tried with project 1, but the files from this folder are now all in a new main branch. These should be in the master branch in the correct folder.

Can someone help me here? Thanks!

First of all, I am assuming that you have already added all files to the staging area. now you should check your branch by running this command on terminal:

git branch

it will show your current branch either main or master

if your current branch is main branch then run these commands it will push your code to master branch

1. Git checkout master 
2. Git pull origin main
3. Git push origin master

if you need more help please let me know in comments.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM