Skip to content

Little scripts and commands for Bash and Git to help productivity

Notifications You must be signed in to change notification settings

VietThan/FunBashScripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fun Bash Scripts

platform language

General Information

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 .

Scripts

  1. AddCommitPush

Takes in argument and add all files, commit with argument as message and push to origin master

  1. CommitPush

Take in argument, commit with argument and push to origin master

Command line

  1. 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

git commands

  1. Keep either files in merge conflicts. Taken from Link

    git checkout --ours keep_local_current_branch_file
    git checkout --theirs keep_other_branch_file
  2. 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
  3. If you're in the business of merging unrelated histories

    git pull --allow-unrelated-histories
  4. To push to remote branch that does not have same name as local branch:

    git push remote local_branch:remote_branch
  5. To checkout a remote branch and work on it

    git checkout --track origin/newsletter
  6. To revert commit without losing changes. Taken from a nice StackOverflow exchange

    git reset HEAD~1 --soft  

Author and Acknowledgements

Author: Viet Than, Department of EECS, Vanderbilt University, US.

About

Little scripts and commands for Bash and Git to help productivity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages