$ git checkout -b [name_of_your_new_branch]
$ git branch --track [new_branch] [remote-branch]
$ git branch [name_of_your_new_branch]
$ git remote show origin
$ git branch -a
$ git checkout [branch_name]
$ git checkout -b [branch_name] origin/[branch_name]
$ git branch -d [branch_name] (to force using -D)
$ git push origin :[branch_name]
Cleaning Old Local Branches With Git (delete at once all local branches that have already been merged to master)
$ git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
$ git branch -v
$ git add -u
$ git chechout -- <file_path>
$ git show branch:<file_path>
$ git commit -am "[commit_message]"
$ git commit -a (with multi line message)
$ git push origin [branch_name]
$ git log
$ git log -3
$ git log -since=yesterday
$ git merge --no-commit test_branch
$ git merge [working_branch_name] --squash
$ git rebase master
$ git stash
$ git stash apply
$ git add <file_path>
$ git stash --keep-index
$ git reset
Last step is optional, but usually you want it. It removes changes from index.
$ git rebase [branch_name]
$ git rebase --abort
When you use
$ git push origin :staleStuff
it automatically removes
origin/staleStuff
so when you ran
git remote prune origin
you have pruned some branch that was removed by someone else. It’s more likely that your co-workers now need to run
git prune
to get rid of branches you have removed.
$ git config core.fileMode false
check resource