Skip to content

Introduction to Git as a solution for developer code sharing.

License

Notifications You must be signed in to change notification settings

myutzy/intro-to-code-sharing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Introduction to Code Sharing

If you're a developer who writes code that other developers will use or modify, you should get comfortable with a version control system. The most popular system is Git, and this tutorial explains how to get started with Git using GitHub.

Code sharing requirements

  • Developers need an easy way to share files
  • Code changes should be tracked
  • It should be possible to experiment with changes without breaking it for others

Code sharing solutions

  • Git
  • Mercurial
  • Subversion
  • Microsoft Team Foundation Server

This tutorial will focus on Git since it is the most widely-used code-management tool. source

Introduction to Git

Git allows developers to take "snapshots" of their code. This makes it easy to refer to previous code versions when something breaks, and to test new experimental changes without breaking the existing stable code.

Here is a summary of how this works:

  1. Create a repository with git init [project-name] or clone an existing repository with git clone [url]
  2. Add files to the staging area with git add [file] or git add *
  3. Commit staged files to the repository with git commit -m “[message]” (This requires repository write-access)

To learn more about setting up and using Git, visit https://help.github.com/articles/set-up-git

Introduction to GitHub

GitHub is the most widely-used implementation of Git. Interactions with code repositories can all be done via the web browser, and additional functionality is provided by desktop clients compatible with GitHub.

GitHub provides an excellent "Hello World" tutorial that teaches you how to use their platform, but I'll summarize the basics below.

Before you begin: Create a free account at GitHub

1. Create a repository

image

image

2. Create a branch

image

3. Change files and commit the changes to the new branch

image

4. Open a pull request

image

5. Merge and close the pull request

image

Git Clients

Although the GitHub website provides a basic demonstration of Git functionality, it is more practical to install a desktop client if you plan to use Git as part of your daily programming workflow. Here is a partial list of Git-compatible clients:

Learn More

This tutorial barely scratches the surface of Git, its GitHub implementation and other version control systems. Here are some additional resources to help you understand code sharing.

About

Introduction to Git as a solution for developer code sharing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published