git useful commands

Created at: 2019-09-10 14:12:34 Updated at: 2019-09-10 14:19:44

in Linux

  • Store all your cred into system helper
    git config --global credential.helper store
    # Set the cache to timeout after 1 hour (setting is in seconds)
    git config --global credential.helper 'cache --timeout=3600'
  • Reset current branch to previous stat
    git reset --hard HEAD
  • Ignore file mode change in current working tree
    # For individual project
    git config core.fileMode false 
    # For system wide all git project
    git config --global core.fileMode false

Final my .gitconfig file looks like

        email =
        name = Vallabh Kansagara
        helper = store
        fileMode = false