Add custom-cmds-in-ubuntu/bin_examples/git_remove_commits_history
This commit is contained in:
		| @@ -0,0 +1,24 @@ | ||||
| #!/bin/bash | ||||
| #  ___  _    _          _ __       | ||||
| # / __|| |_ | |_   ___ | '_ \ ___  | ||||
| # \__ \|  _||   \ / _ \| .__// -_) | ||||
| # |___/ \__||_||_|\___/|_|   \___| | ||||
|  | ||||
|  | ||||
| BRANCH_NAME="master" | ||||
|  | ||||
| if [ -n "$1" ]; then | ||||
|   BRANCH_NAME=$1 | ||||
| fi | ||||
|  | ||||
| git checkout --orphan latest_branch | ||||
|  | ||||
| git add -A | ||||
|  | ||||
| git commit -am "Initial Commit" | ||||
|  | ||||
| git branch -D $BRANCH_NAME | ||||
|  | ||||
| git branch -m $BRANCH_NAME | ||||
|  | ||||
| git push -f origin $BRANCH_NAME | ||||
		Reference in New Issue
	
	Block a user