Archive for the ‘git’ Category

Git hard remove last commit

git reset –hard HEAD~1

Git show last changes in file

git diff composer.json

Git link local branch to remote

git branch –set-upstream-to=origin/branchname

git compare branches

git diff master 0.2   git diff 0.1 0.2

Git overwrite local branch to match remote branch

git reset –hard origin/master

Git force push to overwrite on remote

git push -f origin myremotebranch git push -f myprivate master:master git push -f

Git reset hard to make local as remote branch

git reset –hard origin/master

git http ssl import/export no certificate verify

export GIT_SSL_NO_VERIFY=1

git changing master branch

git checkout new-master git branch -m master old-master git branch -m new-master master

git rename local branch

If you want to rename a branch while pointed to any branch, simply do : git branch -m oldname newname If you want to rename the current branch, you can simply do: git branch -m newname