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

General Discussion

Is there any caution to be exercised in calling 'git pull' from a remote repository?

I've had some minor issues pushing updates to my GitHub repository. I managed to work around or stumble through them all, but I am a bit puzzled by a recommendation in the GitHub help messages. It said to proceed 'git push' by 'git pull', essentially to make sure all the required files exist where they need to be. It didn't actually say that there is no risk in overwriting new files with old when calling 'git pull' but it got me curious whether it would. At the time I felt it would not, but my certainty about what git is doing leaves almost as soon as I stop studying it.

1 Answer

Jeff Jacobson-Swartfager
Jeff Jacobson-Swartfager
15,419 Points

Calling git pull before pushing up to a remote repo is always a good idea, and it becomes necessary when you're working with a team or multiple branches. It is also pretty safe. If there are differences to the same code, the pull will give you a chance to solve the merge conflict.

That's good to know Jeff. I tested this too but that result only stays in my head a matter or hours or days whereas the voice of experience lasts for weeks. Thanks again.