Cannot click on remote git repository

I just jumped into git yesterday via github and left svn. I created a private repo that I intend to use to keep my personal projects in sync between work and home. During the creation of the remote repo, my local files were deleted from work. Last night I was able to pull them onto my laptop at home.

Now I have added some new files to the repo directory at work. I did "git add file name", where "filename" is my file. Then I made "git commit -m" my message "and it seemed to work. Although I can’t press them on the remote. I tried 'git push personal', but got an error:

To git@github.com:geuis/personal.git
 ! [rejected]        master -> master (non-fast forward)
error: failed to push some refs to 'git@github.com:geuis/personal.git'

Svn is really straight forward when it comes to this. I tried to read docs about how Git works, but most of them seem to suggest that you already know the basics.

For my situation, what knowledge do I need to know? A remote repo on Github and two separate checks at work and in the house, which will be manually synchronized with the remote control.

I am on a Mac.

+3
source share
1 answer

To be able to click on the remote control, generally speaking, you need to be aware of the remote branch. Try it first git pull, then git push.

In addition, github recommends git push -u personal masterthat the head be installed remotely

+7
source

Source: https://habr.com/ru/post/1708231/


All Articles