There are two concepts we're dealing with, the first being a code repository. Although there are different types of repository technologies, GIT is the defacto standard currently. Websites such as Github and Bitbucket are popular web services offering free GIT hosting solutions. The key point here being GIT is the actual underlying technology, and will need to be installed on your development box; and Github and Bitbucket are web hosted implementations of GIT.
The proper utilization of GIT and all its features are beyond the scope of this answer, but the primary concept of branches is critical to what you are trying to do. When you create a new project and accompanying GIT repository, you have only one branch, master. This branch would represent the production state of your application. In addition to this, you would create a staging branch. In most development firms this would a secondary server where clients and developers can test code being prepped for release to production. In your case however, this staging state would represent your local development box.
So the developer workflow would be to make changes locally to the staging branch and commit the changes to their local GIT instance and subsequently push the changes back to origin (aka Github or Bitbucket).
This brings us to our second concept, deployment. The repository will manage the various application states, but there is still the issue of distributing these states to the correct servers. There are many options to do this. You could sFTP files locally to the correct server, use Cloud hosting solution provided repository hooks, or code custom hooks on custom remote GIT instance on server. How you should approach this depends on how and where you are hosting the website.
Your hunch that "there has to be a better way" is spot on. You will probably run into many more questions as you start to implement, but the best way to learn them is to attempt to apply to your workflows and continue asking questions.
I anticipate some back and forth on this as there's a lot of information here.
1) Consolidate all code changes, so the files and database on your production server and your development machine are the same. This is very important.
2) Download and install GIT on your development box, if you are on Windows make sure to install the GIT Bash.
3) Create a free account at Github or Bitbucket, I prefer latter because you don't have to pay for private repositories
4) Match a deployment solution to the server hosting the website
GIT Downloads
GIT Basics Guide
GIT Joomla Guide - Basic
GIT Joomla Guide - Advance