How to make git ignore file mode changes?
Answer:
In your current git repository, type
# git config core.filemode false
That's it.
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to make git ignore file mode changes?
Answer:
In your current git repository, type
# git config core.filemode false
That's it.
Fix git's fatal: index file corrupt
Answer:
When you experienced when your git repository might return the following error when you perform the status command, e.g.
# git status
error: bad index file sha1 signature
fatal: index file corrupt
To fix it, simply type
# rm -f .git/index
Then
# git reset
That's it.
How do I diff the changes which have been staged but not committed in Git?
Answer:
Usually when you have not staged your changes, git diff is what you all need. But when you have staged the changes, then you need to use
git diff --cached
How to restore locally deleted files using git
Answer:
To restore all the locally deleted files (but before commit), you can use the following command:
# git ls-files -d | xargs git checkout --
How to delete a branch in Git
Answer:
Assume you have a branch called "feature1", and you want to delete it locally, you can use:
# git branch -d feature1