Getting started learning git
Learn Git and gain some great benefits to assist your coding and team. If you are unfamiliar with Git, there’s some great resources out there to learning this tool, such as this wealth of information from Atlassian on why git. Git is a version control system which allows you to track changes to files and maintain and keep track of different versions of your code.
Git isn’t a programming language to learn, but is a system you can run from any terminal program such as a command prompt on your windows PC, but better tools exist such as git bash or cmdr.
Here’s a basic overview to get started to learn Git.
- Download and run Git
- To ensure its installed, you can go to any project folder, right click and you should see Git GUI Here and Git Bash Here.
- Select Git Bash Here, this will open up a terminal window. This runs in Linux, so you’ll need to know some basic Linux commands.
- Setup a local repository for Git by typing Git init. If you have hidden files in windows on, you’ll see a hidden git folder.
- To configure Git, we can attribute credits to our name and email. type git config –global user.name “Your name” and then type config –global user.email “email address”
- Create a file in your folder to test Git. Type git add filename.txt
- To connect to a remote repository, Create a GitHub account which stores your repositories remotely. Once you do this, you will get instructions how to connect and push your local files to the new remote repository.
I hope this helps you on your way to learning git and GitHub too.
Here is a video directly from Github
1. Learn Git by Collaborate with others
Once you’re familiar with the concept of Using git and GitHub, you can contribute to open source projects by rewriting some code or fixing a known code bug. Even easier you can contribute to open source projects through finding syntax issues, documentation amends or even grammar amendments.
You can contribute to these projects on GitHub by following this step by step guide:
- Fork a repo(repository) on GitHub which copies the repository of the developer to your repository.
- clone the repository to your machine
- Checkout a new branch and make your changes
- Push your topic branch to your forked repository
- Create a pull request on GitHub
- Once the developer requests any changes to your contributed amends, make the suggested changes.
- Once approved , the pull request is merged into the master branch and the topic branch is deleted from the target repo.
2. Supporting developers by sharing code
Using remote repositories on GitHub you can copy(fork) others free public code and use on your projects, as why reinvent the wheel.
3. Test branches(version) of your code
You can Add and test new features to an existing project, all offline until your ready to request them to be added into the main code base.
4. Easy backup your files with Git
Backing up your project couldn’t be easier with git. Running a terminal whether in Windows or visual studio code or cmdr, easily add your changes to the staging area.
Commit your changes and push them to your repository in github with ease. When working on our Web Design Service in live project, I love using Git as if I somehow forget to backup my files to the cloud I always commit my latest project changes to GitHub, and just for this change alone is a great benefit to learning Git.
5. Multiple developers working on one project
Multiple people can work on changes in one project, by creating branches or versions off of the master code base.
Feature branches give developers an isolated environment for changes to the main project. When a developer finishes their changes, they can create what’s called a pull request for the changes to be merged back into the main project.
6. Open source
Great community support and documentation, with books and video tutorials giving you access to what you’ll need to understand and support your companies version control needs.
7. Free storage space for your project files
GitHub has a 100mb maximum limit on files in a repository and 1gb available per free storage account. This is basically free cloud storage and we would be unwise not to utilise this. You can create private repositories to keep your data hidden so no need to worry your project is totally safe.
We hope this has helped you understand Git and the benefits.