Archive for the ‘git’ Category

Git change remote url

git remote set-url origin https://username@hostname:port/project.gitgit remote set-url origin https://username@hostname:port/project.git

Git hard remove last commit

git reset –hard HEAD~1git reset –hard HEAD~1

Git show last changes in file

git diff composer.jsongit diff composer.json

Git link local branch to remote

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

git compare branches

git diff master 0.2   git diff 0.1 0.2git diff master 0.2 git diff 0.1 0.2

Git overwrite local branch to match remote branch

git reset –hard origin/mastergit reset –hard origin/master

Git force push to overwrite on remote

git push -f origin myremotebranch git push -f myprivate master:master git push -fgit 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/mastergit reset –hard origin/master

git http ssl import/export no certificate verify

export GIT_SSL_NO_VERIFY=1export GIT_SSL_NO_VERIFY=1

git changing master branch

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