I will present you some cool command with git. Some commands come from git-extras (package on debian or on github).
Standard git command: git checkout <commit|HEAD> -- <file>
.
Git-extras command: git reset-file <file> [commit]
.
By default reset to HEAD.
Standard git command: git archive -o <output> HEAD
.
Git-extras command: git archive-file
.
File output is <repo name>.<sha1>.zip
.
Standard git command: git push <remote> --delete <branch name>
or git push origin :<branch name>
.
You need next delete local branch.
Git-extras command: git delete-branch <branch name>
.
This will delete local and remote branches.
This will juste remove commits and not changes. Your changes will be in index if you use --soft and deleted if --hard.
Standard git command: git reset --soft [HEAD^|HEAD~number of commit to remove]
.
Git-extras command: git undo [--hard|--soft] [number of commit to remove]
git init
git add <your file> && git commit -m 'Initial commit'
git remote add origin <your remote url>
git push -u origin master
Push a l
local branch to a r
remote branch: git push origin l:r
Push a b
local branch to a b
remote branch: git push origin b
Your HEAD is not in fast-forward with your b
remote branch. You got two choices :
git pull --rebase origin b
git fetch && git rebase origin b
git checkout -
Diff by word git diff --word-diff
Diff by char git diff --word-diff-regex=.
Ignore space change git diff --ignore-space-change
Rebuild github pages via API.
curl -X POST -H "Authorization: token $TOKEN" https://api.github.com/repos/$gh_user/$gh_project/pages/builds