简体   繁体   中英

unable to push changes to github using git

I'm new to git and I have a github repository where I want to commit changes to a python file and push . However after accesing my repository from an ubuntu vm now that I am back to windows 10 when I want to push I get

error: failed to push some refs to 'https://github.com/BillSkentos/MovieFlix2020_E17136_SKENTOS_VASILIS.git'

hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.

I'm completely new to git and tried git checkout master and tried pushing but to same result. I would appreciate your help with this. Thank you in advance

In Git 1.7.0 and later, you can checkout a new branch

git checkout -b <branch>

Edit files, add and commit. Then push with the -u (short for --set-upstream) option:

git push -u origin <branch>

Git will set up the tracking information during the push. Now by using these commands, you will not get any error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM