Bash scripts to increase work flow. For personal use but welcome all to use and add to.
I make symlinks for them within /usr/local/bin .
- AddCommitPush
Takes in argument and add all files, commit with argument as message and push to origin master
- CommitPush
Take in argument, commit with argument and push to origin master
-
Find files larger than 50MB in current directory and children:
$ find . -type f -size +50M
current dir only:
$ find . -maxdepth 1 -type f -size +100M
-
Find processes that are Listening on ports:
$ sudo lsof -i -n -P | grep LISTEN
-
Keep either files in merge conflicts. Taken from Link
$ git checkout --ours keep_local_current_branch_file $ git checkout --theirs keep_other_branch_file
-
Push to single branch. If your Local branch and remote branch is the same name then you can just do it:
$ git push origin branchName
When your local and remote branch name is different then you need to do the following:
$ git push origin localBranchName:remoteBranchName
-
If you're in the business of merging unrelated histories
$ git pull --allow-unrelated-histories
-
To push to remote branch that does not have same name as local branch:
$ git push remote local_branch:remote_branch
-
To checkout a remote branch and work on it
$ git checkout --track origin/newsletter
-
To revert commit without losing changes. Taken from a nice StackOverflow exchange
$ git reset HEAD~1 --soft
Author: Viet Than, [email protected]