简体   繁体   中英

pushing new project changes to github not working

So I'm completely new to git and github but gradually learning.

I went through a tutorial and pushed an existing project up to my git hub.

I've now made some changes to the project and want to push these new changes up to github again. What is the process??

I've been trying a few things but it's not working as easy as I thought. Getting a lot of errors.

I used this method for the first push:

git remote add origin remote repository URL
git push origin master

I tried the same again it isn't working, in the hints it mentions git pull which I'm researching now.

So I've staged and committed everything I need and then wrote this git command to push changes:

git push origin master

These are the hints I got back:

hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushin
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Have you added and commited your changes in your local repo? First of all, use the git status command in your local repo to see if all your changes are commited and ready to be pushed. About the pull msg, maybe you local repo is not synced with your remote. Try git pull origin master in order to sync both.

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