I have a problem doing push in the repository, but when I do push it fails and I get the next ad shown in the image,
I am following these steps through CLI I don’t know what is failing.
git clone https://gitlab.com/autonomicmind/training.git
git checkout -b ozpingux
git branch -u origin/master
git add ozpingux.c
git add OTHERS.lst
git add .
git commit -m “sol(code): #0 codeabbey, 1 (1.0)”
git remote add origin https://gitlab.com/autonomicmind/training.git
git push origin ozpingux
git push https://gitlab.com/autonomicmind/training.git
git diff ozpingux master
git merge master
Why does not work?
Thank you very much, regards!
git push origin ozpingux should be enough. Try deleting the remote branch before pushing again, or
git merge since the repository strategy is fast-forward only.
Also you are using some unnecessary commands, such as:
- Once you clone the repo there’s no need to init again
- Use it to keep track of your modified files, if you use it just after cloning there won’t be any output
- You are already adding the files in the previous commands, no need to add the current directory as well
- This is set automatically in the
.git folder once you clone the repo
- here you can use
git status instead
- you are pushing your changes in the previous command, there’s no need to use this one.
git pull instead, as @roaring-lamport said we use a monorepo fast-forward strategy, there’s no need to merge, unless you want to copy someone else’s branch
Hope it helps