Perhaps nothing is as frustrating to a gardener as losing their hard work and crop to unwelcome wildlife. After working hard all spring to get plants and seeds into the ground, fighting the weather, and conquering the weeds, just when the harvest is to begin some other vertebrate critters begin to harvest the plants. Rabbits, ground squirrels, tree squirrels, pocket gophers, or deer arrive to take advantage of the plantings you have provided--assuming you provided food just for them!
The two major defenses gardeners have against such competition are: repellents and exclusion. Repellents are either area repellents or taste repellents. Area repellents repel the animal by smell. As the name implies, the chemical is aromatic and fills the air in the general area of the planting. The smell is offensive to the animal and it avoids the area. Examples of such repellents include hanging bags of human hair or bars of soap or commercial products like moth balls (naphthalene).
Taste repellents are more effective in that they are applied directly to the plant and repel the animal by having a bad taste. The idea is that the animal may sample the plant once, but the bad taste keeps it from trying it again. Examples include such "home remedies" as cayenne pepper and commercial products containing such chemicals as thiram, putrescent egg solids, or other foul-tasting products.
Repellents are not, however, a cure-all. Area repellents are limited in effectiveness, but may be useful if placed around the perimeter of the garden area. Taste repellents cannot be applied to plants you intend to eat since you would also find the taste offensive, and thus are mostly useful in landscaping. Most repellents must be reapplied regularly, especially after rain or periods of extreme heat. Not all products are registered for or effective against all species. And, if an animal is hungry enough, they will often ignore the bad smell or taste. Despite these limitations, many gardeners may find repellents to be the best alternative in their particular circumstance.
Another more permanent protection against unwanted sampling of your garden is exclusion. You may exclude in several ways, depending upon the area you are in and the situation. Individual plants may be surrounded by plastic tubes, chicken wire, or hardware cloth fences. You may also fence off your whole garden area to exclude the worst offenders – rabbits and deer.
The size and mesh of the fence depend upon what you are trying to exclude. For rabbits, 1-inch mesh "chicken-wire" fence at least 2 feet high will successfully exclude them, especially if the bottom 2-3 inches are buried below ground level. For deer, you may use a variety of fences including electrical tape or strong large mesh of any kind. Old "hog wire" fencing filling many farm gullies will suffice, especially if several sections are erected, reaching a height of 8 feet. In small garden plots, you may be successful with fences somewhat shorter than that, but no lower than 5-6 feet.
Gardeners may find also that general clean-up of garden areas to eliminate the brush, log, or junk piles that provide protective cover for many of the offending critters will help. Also, the presence of pet dogs will often serve as an aversion to these wildlife.
Above all, keep in mind that a reality of gardening is dealing with pests and factors out of your control like weather. Gardens inevitably attract both those critters you want and those you don't. Some damage should be expected. When your tolerance level for such damage cannot be raised any higher try some of these repellent or exclusion methods.