Git
A lot of people reading this will use Git already. There’s a reason for that—it makes life simpler. Having a Git repository for all of your Lambda functions is a great way to work with teams of developers or by yourself on multiple machines.
Installing Git on your system varies depending on your operating system. Linux users can install Git through the command line, macOS users can install using Homebrew or via download, and Windows users have to install Git via download. Details on exactly how to install for your system are available on git-scm.com.
Once you have Git installed, navigate in the terminal to your Lambda folder. When inside that folder, run git init to create an empty repository. When you open your Lambda folder in VS Code, you will now have a number hovering over the Git symbol. This means that you have edited that number of files since your last Git commit.
Committing to Git is like taking a snapshot of all of the work in the folder and saving it. This is useful as it allows you to see how your work changes over time. To commit your work (take the snapshot) you have two options.
You can use the Git integration with VS Code to create the commit. Click on the Git symbol with the number hovering over it. When you click on that, it opens the changes menu, showing you all of the files that you have changed since your last commit, or all of your files if this is your first commit. To commit the changed work, type a message into the message box at the top and click the tick above that:
If you want to use the command line you need to enter git add * to add all of your changed files to the commit you're about to do. Then type git commit -m "My first git commit!". The text between the quote marks is your commit message.
In both cases, your commit message should describe the changes that you've made in this commit. Your first commit will probably be "creating my first function".
Another massive advantage to Git is that you can easily create remote Git repositories. These are data centers that will store your Git commits so you can access them from anywhere in the world. The major two are GitHub and Bitbucket but there are lots more. They both have free versions, but GitHub is only free for public repositories so anyone can see your work.
Once you've signed up for an account and created a repository, you'll be given a URL for it. In your terminal, navigate to your folder and run git add remote origin <your url>. This means that you can send work from your local machine to your online repository. Just type git push origin master to send your latest commits to your online repository. Getting them back is just as simple; just type git pull origin master and your local code will update to add in any changes made in your repository.
This is great for teams as it allows you to all work on your own machines but be able to get each other's changes.