Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.4k points)

I am having my first introduction to git through a class I am taking. I have a number of files in a directory on my computer and am able to stage and commit them without a problem. However, when I try to push files to my github repository, I keep on getting this message:

Pushing to https://github.com/BigMeanCat/CMDA

To https://github.com/BigMeanCat/CMDA

 ! [rejected]        master -> master (fetch first)

error: failed to push some refs to 'https://github.com/BigMeanCat/CMDA'

hint: Updates were rejected because the remote contains work that you do

hint: not have locally. This is usually caused by another repository pushing

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.

Can anybody help me out with what this means and how to fix it? I've seen a few people with similar problems online, but I am BRAND NEW to git and not familiar enough with git's command line language yet. I'm a little hesitant to take certain suggestions, as I don't know whether it will solve the problem or make it worse.

Thanks!

1 Answer

0 votes
by (41.4k points)

It means that someone has pushed work to the remote repository, to merge it with your work you can run git pull --rebase then push your combined work back to the remote repository.

Check out this Git Tutorial to know more.

1.2k questions

2.7k answers

501 comments

693 users

Browse Categories

...