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

Joe Dayvie
Joe Dayvie
11,956 Points

Push & Pull Changes in Git?

Hello,

During the Push & Pull lecture in Git, it seems things may be a little different regarding how to use them? The instructor seems to get different responses than I do and mine talks about new changes with Git 2.0?

If anyone has knowledge on this, its greatly appreciated, thank you!

Joe

Ken Alger
Ken Alger
Treehouse Teacher

Joe;

What specifically are you wanting to know? What differences are you experiencing?

Ken

Joe Dayvie
Joe Dayvie
11,956 Points

Ken,

When I use the git push comment, the video shows a response of "Everything up-to-date" while mine is a lot longer (sorry about the length):


warning: push.default is unset; its implicit value has changed in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the traditional behavior, use:

git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

git config --global push.default simple

When push.default is set to 'matching', git will push local branches to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple' behavior, which only pushes the current branch to the corresponding remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git)

fatal: The current branch new_feature has no upstream branch. To push the current branch and set the remote as upstream, use

git push --set-upstream origin new_feature


Not sure if I did something wrong/different or if there is a change in Git?

Thank you!

Joe

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Joe;

Hmmm... I generally get the "Everything is up to date" message when the data on my machine is the same as on the repositories, thus there is nothing to push. I'll do some research and post back if I find anything conclusive.

Ken

Ken Alger
Ken Alger
Treehouse Teacher

What version of Git do you have on your machine?

Joe Dayvie
Joe Dayvie
11,956 Points

Ken,

git version 2.3.2 (Apple Git-55)

Joe

I also get the same error on git version 2.3.2 (Apple Git-55): [...]

“Since Git 2.0, Git defaults to the more conservative 'simple' behavior, which only pushes the current branch to the corresponding remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git)

fatal: The current branch new_feature has no upstream branch. To push the current branch and set the remote as upstream, use

git push --set-upstream origin new_feature”
Joe Dayvie
Joe Dayvie
11,956 Points

Ken,

This is when I use my personal computer (as I have been this entire time). I am not sure if that may also be a reason? I really appreciate your help =)

Joe