0

Whats the most easiest way to create a repository for my local Java Eclipse Projects? Currently I create a Repo on GitLab an clone it. Then i move the .git folder to the new Empty Eclipse Project. then add, commit and push all. Its so annoying.

Isnt there an easier way to do this?

I've already searched for it, but i can't find anything out about an easier way.

Jan
  • 3
  • 5
  • 1
    Does this answer your question? [How to create a new gitlab repo from my existing local git repo, using CLI?](https://stackoverflow.com/questions/33101962/how-to-create-a-new-gitlab-repo-from-my-existing-local-git-repo-using-cli) – LeGEC Dec 16 '19 at 08:35
  • Maybe this as well? https://stackoverflow.com/questions/20359936/import-an-existing-git-project-into-gitlab – Klaus Dec 16 '19 at 08:36
  • @LeGEC looks good, but it just show me this: `error: src refspec master does not match any´ – Jan Dec 16 '19 at 08:55
  • @Jan : do you have a local branch named `master` ? replace `master` with the name of the branch you want to push ; as said in the post, repeat this for each branch you wish to push to the remote. – LeGEC Dec 16 '19 at 09:20

1 Answers1

0

just try below command in your root project

git init
git add .
git commit -m 'your commit'
git remote add origin <git url> // <git url>: git@mygitLab.com:test.git
git push -u -f origin master
bahram
  • 92
  • 8