by brobinson · 10y ago · 0 comments
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. git checkout -t theirusername/theirbranchnameI 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.