Replace this template with your information
I am trying to initialize a basic repository in GitLab. Here is what I did:
- I created an empty project here in GitLab
- On my Ubuntu 20.04 VM, I created an empty folder, and put some files in itl
- From Ubuntu terminal, I cd’ed into said folder and went git init
- I grabbed the links from the starter project README in the gitlab project and executed them, that is:
As you can see, I keep getting this error. What am I missing?
BTW, I did manage to successfully add one project, an Eclipse/Java project to an empty repo, but forgot to copy down all the steps I did, but in that case it all just worked. Now, I can’t even add a few simple files to an empty repo. I had originally tried using the Gitlab workflow plug-in for VS Code but it would not upload anything
which is why I’m trying to do it the manual way.
Thanks in advance
I think I found my problem. Well, I found two problems. There seems to be a schism between gitlab and github over what the default branch is named (main here, master there). I did a git config --list and noticed that whenever I was doing a git init, it was setting my main branch to be “master” not “main”. The second problem I found was that in gitlab when you create your initially empty project, the main branch is protected, which was causing even the simplest of adds to fail.
I’ve fixed those. However, now I’m trying to add a simple nodeJS/ExpressJS/ReactJS application that consists of client and server portion. The client portion was created by doing an npx create-react-app client. Doing this, however, has resulted in the client folder being a sub-module or something. I have no idea what that is!! I would have thought that anything under my initial structure would be part of the main git branch. So now, I have something that looks like this:
The client folder is inaccessible. I’m not even sure what it’s pointing to.
My end goal is to get everything I need to run a nodeJS app uploaded to Netlify, and I was under the impression I needed it all in one git project. I have server side (the REST API) and client side (the react app). Am I supposed to make these separate GIT projects?
UPDATE: I was able to solve the problem and get both server and client code into gitlab. The solution was to delete the default sub-module that the create-react-app script generates. I did: git rm --cached client (where client was the name of the “app” sub-folder) then I was able to do git add client/*
After that, was able to commit and push to gitlab.