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!

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

General Discussion

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,228 Points

Using the same branch names in different repositories

Hi there,

So I have a growing list of repos now on GitHub and I'm using Treehouse projects to do this. When I'm following a course in Git I like to use the different sections of courses as separate branches. s1, s2, s3 etc.

I was trying to checkout to the next section when I got this...

To https://github.com/jg-digital-media/time_tracker.git
 ! [rejected]        s1 -> s1 (fetch first)
error: failed to push some refs to 'https://github.com/jg-digital-media/time_tracker.git'
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.

And this is after I made sure that all the files were actually ready for committing. I'm now 2 commits ahead of my repo.

Does this mean I can't have 2 branches of the name even if they're in separate Repos? I'm confused, Thanks :)

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,228 Points

It looks like I was able to solve it by doing a simple git pull.

commit 6ae...
Merge: e69f5e8 8006483
Author: author
Date:   Tue Jan 24 17:10:53 2017 +0000

    Merge branch 's1' of https://github.com/path into s1

A new commit now appears in my log

Merge: e69f5e8 8006483
Author: author
Date:   Tue Jan 24 17:10:53 2017 +0000

    Merge branch 's1' of https://github.com/path into s1

I'd be interested in input as to what's happening though :)