Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider checkout of new remote branch #18

Open
djhoese opened this issue Apr 22, 2019 · 3 comments
Open

Consider checkout of new remote branch #18

djhoese opened this issue Apr 22, 2019 · 3 comments

Comments

@djhoese
Copy link
Contributor

djhoese commented Apr 22, 2019

I'm preparing to teach these lessons at my work and got a question from a coworker that I realized doesn't seem to be covered by these lessons. How can someone get a copy of a remote branch that didn't start on their local machine, especially one that wasn't there when they cloned and/or last pulled from the remote repository.

The correct and simplest solution for any modern version of git where the repository has multiple remotes is:

git fetch <remote>
git checkout -t <remote>/<branch>

There is shorter versions of this if you only have one remote and don't already have a branch named <branch> locally, but I think what I have above is more useful in the long run.

Thoughts?

@sstevens2
Copy link
Collaborator

I think it is a great idea. Can you think of a good way to fit it into the lesson 'story'?

@djhoese
Copy link
Contributor Author

djhoese commented Apr 22, 2019

I'm going to walk through the lessons again this afternoon/tonight to make sure I know what I'm talking about. I'll have a better idea where this could fit. My best guess is somewhere in the countries portion but I'm not sure what the purpose of it would be except to look at someone else's work. It could easily result in cognitive overload if it was about resolving merge conflicts with someone's branches.

Oh, maybe someone has a typo in their branch and you want to fix it...eh, maybe not. I'll think about it tonight.

@sstevens2
Copy link
Collaborator

I think maybe you are right about cognitive overload. They are already a bit overloaded and we are short on time. I actually never usually get to the part where you update the PR in the lessons already. Maybe it is something to put in an aside/call out or have an extra lesson for if people want to explore on their own?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants