Misc

  1. list of unmerged files and locally changed files:
    (git diff --no-commit-id --name-only origin/$parent..HEAD; git status --porcelain | sed s/^...//) | sort | uniq
    
  2. Skip gitlab CI
    git push -o ci.skip
    
    Source: 1
  3. Restore staged file
    git restore --staged <file>
    
  4. Remove a git commit which has not been pushed
    git reset --hard HEAD^
    
    Source: 1