Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Git Basics Working With Remote Repositories Pushing and Pulling

huckleberry
huckleberry
14,636 Points

Error after the initial git push command.

Ok, in the video at around 1:05 Tommy does the initial simple git push command that returns the Everything up to date console message.

However, when I do it, I'm getting this...

A couple of things...

I started the lesson over again half way through because there was another thing that was very different later in the video. So I thought, maybe I did something wrong.

I reloaded the console and started from scratch by deleting the our_clone_project directory with the rm -r our_clone_project command.

Sidenote: This thing asked me to confirm for every file in the damn thing because it was all "protected" so I had to press Y enter about 25 times. Is there a quicker way to do that? A way to delete a directory and tell the console that yes, even all the protected files, right in the initial command?

Ok so that's gone, then I went in and removed the remote setting from the my_really_cool_project directory using the git remote rm our_clone command.

Don't forget, I started over half way through the video so I was trying to set it back to the way it was in the beginning of the video.

So now, from the beginning.

  • Create the new repository using git clone
  • go in and check that everything is fine with git remote, it's fine.
  • go back to my_really_cool_project and set that to have the other directory as its remote with git remote add our_clone ~/our_clone_project
  • check with git remote. everything's fine
  • cd ~/our_clone_project
  • create new branch with git checkout -b new_feature
  • now I'm in there.
  • edit file2 with nano and save changes... exit
  • commit changes with git commit -a -m "etc..etc.."
  • it commits it successfully
  • git push

And that's where things are different. I understand that he uses git push in order to show us that without further parameters we'll only get an "everything's fine" message. But why am I getting what I'm getting?

Thanks!

Huck - :sunglasses:

1 Answer

Mohammed Ali
Mohammed Ali
11,134 Points

Hi - it looks like you just typed git push and not where to push to and the branch ... you need to type git push origin new_feature and it should be good.

huckleberry
huckleberry
14,636 Points

Hey there slugger,

Thanks for the reply. I wound up just deleting like... everything and starting the videos all over again. I figured, why not? Gonna repeat the video series anyway (I always do) so might as well start now.

I'll make a note of your observation for the future though.

Thanks!

Cheers,

Huck - :sunglasses: