Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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?