D
D
Dmitry Vatlin2019-05-21 12:27:23
git
Dmitry Vatlin, 2019-05-21 12:27:23

How to link a folder in VS Code to a Github repository?

Good afternoon!
How to link an existing folder in VS Code to a remote repository on Github? I work on Linux. Git installed. Tried to do this:
1) git remote add origin <repository address>
2) git add .
3) git commit -m origin
4) git push --set-upstream origin master
"To <repository address>
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to <repository address >
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart.Integrate the remote changes (eg
hint: 'git pull ...') before pushing again.hint
: See the 'Note about fast- forwards' in 'git push --help'
Questions:
1) Is the command sequence correct?
2) What to do with this error?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2019-05-21
@Xuxicheta

git pull
everything is written. Github refuses to accept your changes, because your local copy is behind the remote one, and the local one needs to be synchronized, pick up the latest changes.
VS Code has nothing to do with it at all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question