3 ms·
I dislike the idea of using 'origin' for my own remote name. I keep 'origin' as the canonical remote and my local master branch tracks origin/master. I use pe
by brobinson 10y ago
I dislike the idea of using 'origin' for my own remote name.
I keep 'origin' as the canonical remote and my local master branch tracks origin/master. I use people's usernames for their remotes (including for my own).
If I'm pushing a feature branch to my own remote:
git push -u myusername mybranchname
If I need to checkout someone's PR, it's:
git remote add theirusername git@github.com:theirusername/repo.git
git fetch theirusername
git checkout -t theirusername/repo
I've seen people at work who are new to git/Github struggle a lot with the 'origin'/'upstream' differentiation recently, especially when they're learning branching, and they don't seem to have any problems once I switch them over to using 'origin' + usernames.
- dom0 10y ago> If I'm pushing a feature branch to my own remote: I grew so tired of that that I just wrote a little wrapper script, that just does the right thing (tm). So it's $ shit push for me.
- cynicaldevil 10y agoSame here. Except I use 'myfork' as the name for my remote repo. Origin/upstream always got me confused when I first started learning Git, so I created my own naming conventions.
- brobinson 10y agoToo late to edit, but that should be: git checkout -t theirusername/theirbranchname
- rcfox 10y agoFYI: GitHub will create a branch in your repo for pull requests. You shouldn't need to pull directly from someone else's repo just to look at their pull request. http://stackoverflow.com/a/30584951 http://stackoverflow.com/a/30584951
- brobinson 10y agoDidn't know you could pull by ID! Thanks!