GIT Usage Notes

These are a list of some common GIT usage notes the developers of FreePBX have come across.

Remove Merged Local Branches

git branch --merged | egrep -v "(^\*|master|release|dev)" | xargs git branch -d


Remove Merged Remote Branches

git branch -r --merged | egrep -v "(^\*|master|release|dev)" | sed 's/origin\///' | xargs -n 1 git push --delete origin git remote prune origin

Submodule Updating Recursive:

# Update the submodule URLs git submodule foreach --recursive sync # Update the submodule files git submodule update --init --recursive 

Reverting Pushed Commits:

A single commit

Note that if you're reverting a commit that has since been changed by a DIFFERENT commit, you will get conflicts and you'll need to manually resolve them. This is one of the (many) reasons why it's good to do a few small, easily compartmented changes per commit.

The last couple of commits were written when I was well past the Ballmer Peak, and should be thrown away for the good of humanity. So I'm just going to revert everything I've done for the past few commits. 

Return to Documentation Home I Return to Sangoma Support