Created
July 6, 2012 11:21
-
-
Save elmoswelt/3059625 to your computer and use it in GitHub Desktop.
GIT Stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create git Repo | |
--------------- | |
cd my_project | |
git init | |
git add * | |
git commit -m "My initial commit message" | |
git remote add origin [email protected]:my_project.git | |
git push -u origin master | |
Push an existing repository from the command line | |
-------------------------------------------------- | |
git remote add origin repo URL | |
git push -u origin master | |
Squash commits into one commit. | |
------------------------------- | |
git checkout master | |
git pull | |
git checkout -b newBranch | |
git merge --squash myBranch | |
Update submodules | |
----------------- | |
git submodule update --init --recursive | |
Update submodules on every pull | |
------------------------------- | |
git config alias.pullall '!f(){ git pull "$@" && git submodule update --init --recursive; }; f' | |
Cleanup Branches | |
---------------- | |
http://devblog.springest.com/a-script-to-remove-old-git-branches |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment