You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git branch -d branch_name # Delete Local branch use -D for force
git push -d <remote_name><branch_name># Push the deletion
Rebase (Change git history)
git rebase -i <commit>
Update submodule
git submodule update --init --recursive
Bak to last commit / reset
git reset --hard # removes staged and working directory changes
git clean -f -d # remove untracked
List conflicted files
git diff --name-only --diff-filter=U
remove submodule
# http://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule
mv asubmodule asubmodule_tmp
git submodule deinit asubmodule
git rm asubmodule
# Note: asubmodule (no trailing slash)# or, if you want to leave it in your working tree
git rm --cached asubmodule
mv asubmodule_tmp asubmodule
Stash
git stash # stash current brand
git stash list # list existing stash
git stash apply # apply last stash
git stash apply stash@{n} # n -> number of stash
git stash pop # apply last stash
basics
Clone
git clone https://github.com/repourl.git
add files to index
git add path/to/the/file.md path/to/the/file2.md
# Add all files - be carful
git add .
Push - send to server
git push # if cloned
git push --set-upstream origin branchName # if new branch
branch
# Create branch form current state
git checkout -b bName