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

Jacob Goh
Jacob Goh
2,470 Points

encounter warning while pushing

encounter this while using 'git push'

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)

What should i do?

4 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,441 Points

When pushing, git needs to know where you are pushing to. Do you have a remote defined? Use:

$ git remote -v

to see your remote connections. Use git remote add origin <URL> to add the connection. See adding a remote

Try to push on remote like this

git push origin master

the word "master" is referred to the chosen <branch>

I encountered the same problem and was able to change my global default.

git config --global push.default <option>

if you type in git help config you can see what options are available.