The word "onion" is homophonic with "rush", so bringing green onions into the house is to wash away bad things.
In addition, bringing green onions into the house also means ward off evil spirits, because green onions have a special aroma, which can purify indoor air and make people feel comfortable and happy.