I have a local git project that contains some branches (master & others) i would like to push it to a new gitlab repo so: 1. I created a new gitlab repo with:
Initial commit
then i run
git commit -am "some message" git add remote gitlab <url-to-repo.git> git push gitlab master
it dosent work and shows:
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://gitlab.com/myName/myrepo.git '
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
when i tried: git push gitlab master -f it dosent work also, and get:
error: failed to push some refs to 'https://gitlab.com/myName/myrepo.git
and the same result if i add: --force or -f option