In Git you can add a submodule to a repository. This is basically a sub-repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
| // ==UserScript==// | |
| // @name Google Redirect Remover | |
| // @namespace https://gist.github.com/mwurzberger/ab83f6f005afce59bb41 | |
| // @description Stop google links from using their tracking redirect | |
| // @version 1.0.0 | |
| // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js | |
| // @include http://*.google.com/* | |
| // @include https://*.google.com/* | |
| // ==/UserScript== |
| #!/bin/bash | |
| version=1.0.1 | |
| versionDate="2014-02-14" | |
| function showHelp() { | |
| echo "watchfile - monitor file(s)/command and perform action when changed | |
| Possible ways of usage | |
| ---------------------------------------- |
| import javafx.animation.*; | |
| import javafx.application.Application; | |
| import javafx.scene.*; | |
| import javafx.scene.image.Image; | |
| import javafx.scene.layout.StackPane; | |
| import javafx.scene.paint.*; | |
| import javafx.scene.shape.Sphere; | |
| import javafx.scene.transform.Rotate; | |
| import javafx.stage.Stage; | |
| import javafx.util.Duration; |
| import java.io.IOException; | |
| import java.io.PrintWriter; | |
| import javax.servlet.Servlet; | |
| import javax.servlet.ServletConfig; | |
| import javax.servlet.ServletException; | |
| import javax.servlet.ServletRequest; | |
| import javax.servlet.ServletResponse; | |
| import javax.servlet.http.HttpServletRequest; |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
| #/bin/bash | |
| #-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password | |
| REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'` | |
| if [ -z "$REPO_URL" ]; then | |
| echo "-- ERROR: Could not identify Repo url." | |
| echo " It is possible this repo is already using SSH instead of HTTPS." | |
| exit | |
| fi |
git config --global alias.alias "! git config --get-regexp ^alias\. | sed -e s/^alias\.// -e s/\ /\ =\ /"
Thanks Asclepius!
Then you can git alias to see them all
git remote rename <old-name> <new-name>
| // ==UserScript== | |
| // @name Flickr Plus One Like | |
| // @namespace http://mozilla.status.net/loucypher | |
| // @description Add Google+1 and Facebook Like buttons | |
| // @author LouCypher | |
| // @license free | |
| // @match *://*.flickr.com/photos/* | |
| // @include http://www.flickr.com/photos/* | |
| // @include https://secure.flickr.com/photos/* | |
| // ==/UserScript== |
| // ==UserScript== | |
| // @name Show Password onFocus | |
| // @namespace http://zoolcar9.lhukie.net/ | |
| // @description Show password when focus on password field | |
| // @version 20130114.01 | |
| // @author LouCypher | |
| // @license free | |
| // @homepageURL http://userscripts.org/scripts/show/1892 | |
| // @updateURL https://gist.github.com/raw/1870154/show-password-onfocus.user.js | |
| // @downloadURL https://gist.github.com/raw/1870154/show-password-onfocus.user.js |