What is the reason of the existence of Gitlab Web Interface that can creates folder, branch,etc?

Viewed 20

I hope my elementary question is not a duplicate. I'm very new to gitlab and other source control management system. I created a project on gitlab and added some directories and files using web IDE. My question is:

1-why there is such a GUI feature in Gitlab to create branches, directories,etc? I always thought that i always create my project LOCALLY and then push it to my remote repository and it seems to me strange to work (write codes, add branches,...) directly on remote repository. Does it mean we can work on a project with gitlab without even needing to have a LOCAL repository? and we do all the development process through the GUI?

2-When we have a LOCAL repository on which we develop, is there any need to use gitlab web Interface for any reason?

3-I noticed that all the stuff that i do through web Gui is committed. So these Commits on GUI side will be merged to the LOCAL committed that i do on my LOCAL repository on my PC?

Thanks for any insight

1 Answers

From my own experience you can indeed work in the gitlab GUI for small changes, however pushing a project is much easier if you work locally. If you want to merge your local branch with changes you've made through the GUI you have to use a few commands first.

If branch B is at local, You can merge A to B locally and push B to remote:

git checkout B
git merge A
git push origin B

If you don't have B at local, you can push A to remote and pull request to merge A to B and click merge button on gitlab.

or, fetch B branch to local and merge A to B , then push B to remote, like this:

git checkout master
git fetch origin B:B      (fetch B to local)
git checkout B            (checkout to branch B)
git merge A               (merge A to B)
git push origin B         (push merged branch B to remote)

I hope this brought you some insight, let me know if there's anything I can do better in the future.

Related