gitlab uploading code with command line

Take the following steps to upload code:

1) because the branch is written protected, generate a ssh key first toaccess to the repo. Follow https://git.i2r.a-star.edu.sg/help/ssh/README(Generating a new SSH key pair) to proceed with generate new SSH key.

since I have tried several times previous to git add . and git push, theerror

git add .

git pull

the error report "fatal: refusing to merge unrelated histories"

use

git pull origin master --allow-unrelated-histories

to fix the problem.

git commit -m "Add all my files"

git push -u origin master

你可能感兴趣的:(gitlab uploading code with command line)