git status
git branch
git checkout master
git pull origin master
git checkout -b developer_branch
git add . (git add -A for deleted files)
git commit -m "your commit message"
git pull origin master
git push origin developer_branch
git reflog /*check commit ID*/
git diff-tree --no-commit-id --name-only -r commitID
/*check All commited files from commit id*/
1.Reset Commands
git fetch /*to update local branch with latest remote changes*/
git reset --hard origin/master /*to reset your branch or master branch.*/
git fetch
git reset --hard origin/master filepath /*reset single file*/
git reset --hard commitid /*reset your branch to previous commit*/
2.Search in repository
git grep "text" /* search file */
git reflog | "commit message" /* search commit message */
3.Delete branch
git branch -D developer_branch /* delete developer branch */
4.Remove all branches that are not for example 'master', 'foo' and 'bar'
git branch -D `git branch | grep -vE 'master|foo|bar'
5.Delete all staging branches
git branch | grep 'staging.' | xargs git branch -D