Skip to content

Latest commit

 

History

History
42 lines (21 loc) · 1.12 KB

12-extra.md

File metadata and controls

42 lines (21 loc) · 1.12 KB
  1. git ls-files -s

    shows information about files in the index (the .git/index file) and the working tree

  2. git remote show <remote_name>

    git remote show origin

    • list down all the remote branches and
    • know the mapping among local and remote branches
    • the impact of git pull and git push on local and remote branches
    • Sync status of each local branch with their corresponding remotes.
  3. git reflog

Reflogs track when Git refs were updated in the local repository, show all HEAD reflog

gif_reflog

  1. git blame [file]

display of author metadata attached to specific committed lines in a file

  1. git grep

Print lines matching a pattern

  1. git fetch --all

    First, run a fetch to update all origin/<branch> refs to latest

    git branch backup-master

    Backup your current branch

    git reset --hard origin/master

    Force an overwrite of local files on a git pull