Version control is very important aspect of any software project development. Many version control platforms are available such as Git (distributed), Monotone, Apache Subversion (centralized), Mercurial. Version control is ideal for large project teams. It allows us to make changes to files to access them later by using its version. Version Control with Git is preferred by many software developers and managers due to its ease of ease and availability.
GitHub is a platform used to host the Git repositories. It can be accessed using Github.com. Github is responsible for code management, sharing and continuous integration.
Benefits of Version Control
- Easy code sharing
- Easy code change communication among developers.
- Tracking of changes are very easy
- Code maintenance is easy
A central server repository is available which contains the official copy of the codebase. This server maintains the history of the repository. A check-in and check-out can be done to access files inside the repository.
Version Control with Git is an example of distributed version control system. In Git, you can pull and clone the changes made inside the repository files. Local repository contains copy of the files in the server. Local repository also contains the version history.
Some important operations of Git are local such as:
- Check in / check out
- Commit changes
- Push changes
Benefits of Version Control with Git
- Repository files are highly secure
- Wide usage in development community
- Widely accepted
- Easy branching capabilities
- Fully distributed system
The working of a Git model is shown below:
Basic Steps to follow in Github for development
- Create repositories on local computer
- Add new files in repository and add file to staging environment
- Make a commit
- Connect to repo in local
Basic workflow in GitHub
- Make commits on computer A
- Push commits from computer A
- Pull commits to computer B
- Add another commit on computer B
- Push new Commit
First Time Git setup
The commands for Git setup can be run on Command prompt (windows) or bash.
For initial Git configuration for Git repository, set the name and email config.
The following steps are be used for initial config
$ git config --global user.name "github user name" $ git config --global user.email user_email
To verify enter:
$ git config -list
To set editor use:
$ git config –global core.editor
To create a new Git repository enter( this creates a ‘git’ directory ):
To add a file in new repository use:
git add file_name
To commit a new file use:
git add git commit -m “message”
To push the new file use:
git push -u origin master
Be First to Comment