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

Matthew Canham
Matthew Canham
11,003 Points

Git Push and Pull

I have just completed the Git Basics course.

I was wondering if someone would be able to help me with clarifying the following.

When using git pull or push you have to specify a <remoteName> and a <branchName> (unless pre-specified in your config file).

Can someone please clarify for me what the <branchName> part of this argument is? In the case of a git push would it be the branch that you want to push from, on your system, or the branch that you want to push to, on the server?

1 Answer

Nicholas Olsen
seal-mask
.a{fill-rule:evenodd;}techdegree
Nicholas Olsen
Front End Web Development Techdegree Student 19,342 Points

Can someone please clarify for me what the <branchName> part of this argument is? In the case of a git push would it be the branch that you want to push from, on your system, or the branch that you want to push to, on the server?

I believe it is both. If <branchName> is not on your local system then you can't push it because it doesn't exist. If <branchName> is not on the server, then it will be created.

Matthew Canham
Matthew Canham
11,003 Points

Fantastic, thanks for the help. So you can push or pull any part of your programme no matter which branch you are checked out under?