Problem with GIT when uploading for the first time to the remote

2

Create a github repository to upload an academic project that I am doing. Install the gitbash to work in windows with the command console, configure the global variables of user.name user.email .

Execute the following statements

git add 
git commit - m"primer commit"
git remote add origin https://github.com/cristian16b/SICU.git

The problem happens when git push because it generates the following error that is shown in the screenshot:

If you can guide me or give me any recommendation, it will be welcome. I'm taking my first steps with git. Thank you very much

    
asked by Cristian Budzicz 16.10.2018 в 02:03
source

1 answer

2

I'm not an expert with github but something similar to what your error says integrate the remote changes (e.g 'git pull' ...) before pushing again

try doing a git pull of your remote repository, Maybe if you have added or modified a file from github and not from your pc, you have to bring those changes to your local and mix them with your repository.

There are 2 ways to bring changes to your repo on github and then mix them with your local repo.

the first is with git fetch [origin] [master] origin is your remote repo and master is the master branch EYE do not put the brackets [], just put what is inside, if you have other names for the remote and the branch, because that you will know. This is to bring you the changes ... and then to mix them you use git merge

the 2nd way is easier since it brings and mixes once and is with git pull [origin] [master]

after bringing you and mixing the changes you just have to do the typical of git add . , git commit -m "mensaje" and finally the git push [origin] [master]

Well, I hope that resolves your error.

    
answered by 16.10.2018 / 02:49
source