Sergey Nivens - Fotolia

Problem solve Get help with specific problems with your technologies, process and projects.

Use Git to version-control AWS app development

Our developers are looking for a simple way to keep tabs on code for AWS app development. How can GitHub help them manage and share application code?

Keeping track of application code is time-consuming, challenging and error-prone without the right tools. Using GitHub with Amazon Web Services is a popular repository that manages and shares code effectively. You can also use Git software to create a repository.

Git formalizes version control, eliminating the need to name files with version numbers or recreate the state of your code as it existed before you made the last known good changes. Git allows you to save versions along the way. It also streamlines sharing code with others.

A big advantage of Git is that collaborators can always get the latest good version of the code from a central repository. As long as you get into the habit of saving incremental and stable versions, collaborators will have access to those repositories.

Getting started with Git

After installing the software, the first step is to create a repository.

Use the "git init" command to create a new repository; this is basically a directory with a .git subdirectory. If you want to make a copy of an existing repository, you can simply copy or clone it with the "git clone" command. If you are using Git to version-control your own work, you might start with an empty Git repository. Then you can add files with the "git add" command; this tells Git to keep track of added files.

Once you've made changes to files, you can update a Git repository with the "git commit" command.

When you work with multiple repositories, it's typically a pull-and-push code method. A pull operation copies code from a remote Git repository and puts it in your repository. Push does the opposite: it puts a copy of your code in a remote repository.

Git also allows for branching, which makes logical copies of code so you can have multiple versions. This is useful for trying an idea and rolling back if it doesn't work.

About the author:
Dan Sullivan holds a Master of Science degree and is an author, systems architect and consultant with more than 20 years of IT experience. He has had engagements in advanced analytics, systems architecture, database design, enterprise security and business intelligence. He has worked in a broad range of industries, including financial services, manufacturing, pharmaceuticals, software development, government, retail and education. Dan has written extensively about topics that range from data warehousing, cloud computing and advanced analytics to security management, collaboration and text mining.

Dig Deeper on AWS tools for development

Join the conversation


Send me notifications when other members comment.

Please create a username to comment.

Has your enterprise used Git for AWS application development?
Git has assisted us in formalizing version control which eliminates the necessity of naming files with version numbers as well as changing back a code to the previous status before any last compatible changes. It is a platform that saves versions as you streamline their sharing codes which means you can easily get the latest version from a central repository. This repository can be newly created or copied from an existing one.
Git yes, AWS, I'm not sure.  Git provides a great deal of power in versioning, that I think many companies will use, regardless of what 'host' or private cloud they use.
The new mantra is "if it doesn't exist on GitHub, it doesn't exist". We keep all our project repos on GitHub (mostly public, some private), We don't build apps specifically for AWS, but try and build them such that they can work across any public cloud, including AWS.
I use GitHub's site as an online filing system to host Git repositories, share code, and manage files like Final Cut projects and Word documents.
It might be helpful to highlight a couple things:

- GitHub is a SaaS implementation of the Git code repository. It offers both "public" and "private" repos, as well as a number of add-on collaboration features.

- Git is the code respository software, and can be run on-prem (private) or on a public cloud (you manage it, not GitHub)