-
Notifications
You must be signed in to change notification settings - Fork 68
Git And GitHub Tips
Append ?w=1
to GitHub diff urls to ignore whitespace. For example
Before: https://github.com/SketchUp/sketchup-stl/commit/18c8d6e9aaf9d21b81a3b132fd2a76bd5657fa7a
Here's some code for a bookmarklet to append ?w=1
to the current url:
javascript: window.location = window.location.protocol + '//' + window.location.hostname + window.location.pathname + '?w=1';
(via http://confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)
You can interactively select chunks of a file to stage using git add -p filename
Loading extensions directly from your repository using symlinks on Windows.
- Run a Command Prompt as Admin.
-
cd
to your Plugins folder.cd c:/users/jim/dropbox/plugins
Linking the folder:
Plugins>mklink /d sketchup-stl C:\Users\Jim\Documents\GitHub\sketchup-stl\src\sketchup-stl
and linking the file:
Plugins>mklink sketchup-stl.rb C:\Users\Jim\Documents\GitHub\sketchup-stl\src\sketchup-stl.rb
Note - the location of your plugins folder may be different.
By default, when using GitHub Windows client, you clone your fork it just sets up your fork as the 'origin' remote. So calling git remote -v
returns for my [briangbrown] fork:
origin https://github.com/briangbrown/sketchup-stl.git (fetch)
origin https://github.com/briangbrown/sketchup-stl.git (push)
The README is referring to adding SketchUp/sketchup-stl
as a remote so you can pull in changes from this repo into your fork. Details here (which is basically the same as the link you posted) https://help.github.com/articles/fork-a-repo
So after calling git remote add upstream https://github.com/SketchUp/sketchup-stl.git
calling git remote -v
returns
origin https://github.com/briangbrown/sketchup-stl.git (fetch)
origin https://github.com/briangbrown/sketchup-stl.git (push)
upstream https://github.com/SketchUp/sketchup-stl.git (fetch)
upstream https://github.com/SketchUp/sketchup-stl.git (push)
And now you can get upstream changes by calling
git fetch upstream
git merge upstream/master
then push them to your fork on github by calling
git push origin master
https://github.com/SketchUp/sketchup-stl/issues/28#issuecomment-9930729
Some interesting topics on StackOverflow on how to deal with development feature branches and what to do with them after a feature is completed.
When you know a particular branch is going to be reused soon it's no point in closing it off. When you resume it, just merge master
back into the branch with the latest changes.
- http://stackoverflow.com/questions/8614112/how-to-close-off-a-git-branch
- http://stackoverflow.com/questions/10242924/how-to-close-a-branch-without-removing-it-from-history-in-git