Git head reference is broken of a branch

How to fix Reference Head is broken of certain branch. 1.Try to stash save first 2. Try to switch to other branch like Master 3. Delete file from “.git\refs\heads\{branch name}” 4. Delete file from “.git\refs\remotes\origin\{branch name}” 5. if still not…

Git exclude file if gitignore not works

# Exclude from the management of Git $ git update-index –skip-worktree path/to/file # Restore back $ git update-index –no-skip-worktree path/to/file # If ignore file not working use this code below before push $ git update-index –assume-unchanged — config.php # for…

Git show commit history & log

Git show commit list history $ git log -2 commit 089201879533848b55c957db2f7a6144d3a49159 (HEAD -> survey_video) Author: mr.chowdhury <mr.chowdhury@blmanagedservices.com> Date: Wed Oct 9 10:22:26 2019 +0600 temp file changes commit d3e41bb19d25e9121721ee57944a14df1a04f136 Author: mr.chowdhury <mr.chowdhury@blmanagedservices.com> Date: Wed Oct 9 10:12:32 2019 +0600 file…

Git repo setup for first time

Git global setup git config –global user.name “Raihan Chowdhury” git config –global user.email “mr.chowdhury@blmanagedservices.com” Create a new repository git clone https://gitlab.com/mr.chowdhury/test-repo.git cd test-repo touch README.md git add README.md git commit -m “add README” git push -u origin master Push an…