Category Archives: GIT

Update git submodule

git submodule foreach git pull origin master

Fetch Branch (Single or All)

fetch single branch

git branch -f local_name origin/remote_name
git checkout -b local_name origin/remote_name

fetch all branches

git fetch

Change Branch name on GIT

git branch -m newname

GIT diff between files in different commit

git diff START_COMMIT..END_COMMIT -- path/to/your/file

Create local branch from remote branch (GIT)

git checkout -b BRANCH_NAME origin/BRANCH_NAME


git fetch origin origin/BRANCH_NAME:BRANCH_NAME

Export GIT Repo (zip)

git archive --format zip --output /path/to/ master 

Ignore chmod changes on GIT

git config core.filemode false

thanks Piero!/pierophp

list assume-changed files on git

git ls-files -v | grep "^[[:lower:]]"

prune to remove old remote tracking branches

remove branch from server

git push origin :YOUR_BRANCH

remove local branch

git branch -D :YOUR_BRANCH

remove old branch from server

git remote prune origin
Page 1 of 11