Here is a collection of links related to performing a Github pull request, including a few different versions of that workflow:
When you get the Git
checkout error, “Your local changes to the following files would be overwritten by checkout,” one likely cause is that files in the master branch are indeed newer than the files in your feature branch.
But another possibility that I just learned about is that you did a
git add, but forgot to do a
git commit before trying to switch branches. My current wrong/accidental workflow looks like this:
Here are some brief notes related to handling some comments on a Github pull request. Every other pull request I’ve done has been simply accepted, but I’m currently working through a conversation related to a large pull request. Here are the notes:
git fetch wasn’t showing the comments/changes I just approved on Github, but this set of commands successfully pulled those changes from Github and brought them onto my system:
git branch #to list the branches git checkout my-branch-name #switch to my branch git pull origin my-branch-name
I haven’t worked on many open source projects, so my ability to fork a Github project, pull it down, create a branch, push that branch back, and then submit a pull request are weak, at best.
That being said, I’ve done it a few times lately, so I’m getting better at it. Today was a very smooth process, so I thought I’d make these notes while they’re still fresh in my mind.
The Tower app website has a good description of git fetch vs pull. “You can never fetch often enough” is a helpful phrase.
This article titled, Little things I like to do with git, has a fun series of git commands.
While I’m in the Mary Rose Cook neighborhood, she also wrote this excellent Git tutorial.
This SO tip on how to automatically remove/delete all files from a Git repository that you have already deleted on disk is a real timesaver. Of course it’s a wee bit dangerous (and probably won’t work on Windows), but that’s part of its charm.
If you attempt to do a normal
git push origin master after adding a tag, you’ll get an “Everything up-to-date” message from Git. In short, this is because you have to push a tag to the origin just like you push a branch.
In my case I just created a tag named
v0.1, so I pushed it like this:
git push origin v0.1
The output from the
git push command looks like this:
Yesterday I needed to be able to specify a port with a
git clone command, because the git server runs ssh on a non-standard port. In short, the solution was to put this text in my ~/.ssh/config file: