Skip to content

Instantly share code, notes, and snippets.

@elmoswelt
Created July 6, 2012 11:21
Show Gist options
  • Save elmoswelt/3059625 to your computer and use it in GitHub Desktop.
Save elmoswelt/3059625 to your computer and use it in GitHub Desktop.
GIT Stuff
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