This is a companion discussion topic for the original entry at https://thoughtbot.com/upcase/videos/git-github-and-remotes
This is a companion discussion topic for the original entry at https://thoughtbot.com/upcase/videos/git-github-and-remotes
Isnt the last alias git fall
obsolete and the same as git fetch --all
?
@durandom Indeed it is obsolete! I’m not sure how long --all
has been available, but I certainly have it in my installed git version.
I’ve updated the video notes to clarify this, although I think the fall
alias example is still a useful example of the sort of functionality we can build in aliases.
@christoomey thanks for this series on git. I was listening to you and @benorenstein talk about this on the podcast and I just wanted you to know even though it was a beast, it is very appreciated.
I have a question regarding your use of the git-pr command. If you start with a feature branch locally, then “publish” it, it gets tracked remotely as initials-feature.
So if I’m working on my “feature” branch and do ‘git pr’ it errors because the “feature” branch doesn’t exist on the origin remote, only the one with initials prepended.
Anyway, do you just eventually checkout the branch named with your initials and work from there in order to get git-pr really work for you? Just wondering.
Hello @pdbradley, thanks for the kind words. Really glad the effort on Mastering Git is appreciated.
For you question, a local branch can be “tracking” an upstream branch. This is configured when you initially push the branch with git push -u local-name remote-name-with-initials
, where -u
is the switch for “set upstream tracking”.
My actual script for git-pr is a total mess, but the workings of it look up that upstream branch, then use that to create the needed GitHub URL.
Hope that clarifies.
Ah, somehow I had an old git-pr that was merely a shell script.
Well I tried your ruby one out, but got lost at this gist-vim line:
auth = “Authorization: #{File.read(File.expand_path(”~/.gist-vim")).chomp}"
but no worries, from looking at your ruby one I modified my simple shell one to do the job.
This was an amazing episode, thank you so much for this! Didn’t knew about the special way to set a different name between my local & remote branches, really useful.