By: Madona Syombua , Founder Budgeting Buddy , Android Lead WWCode Mobile  .

Twitter: @madona_syombua

 

 

@madona_syombua   x  @wwcodemobile

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

What is Version Control?

Version Control is the management of changes to documents, computer programs, large websites and other collection of information.

There are two types of VCS:

  • Centralized Version Control System (CVCS)
  • Distributed Version Control System (DVCS)

Demo Commands: Get from GitHub

C:\Users\Public\WWCode Git>git clone https://github.com/WomenWhoCode/WWCodeMobile-solving-Java-algorithms.git
C:\Users\Public\WWCode Git\WWCodeMobile-solving-Java-algorithms>git status

Git add . – this adds your work to local , after you’ve made your changes to the new created branch, in this case “git_lesson”

C:\Users\Public\WWCode Git\WWCodeMobile-solving-Java-algorithms>git add .

Git commit –m “Message “ – this ensures that work is ready to be staged or pushed to up stream

C:\Users\Public\WWCode Git\WWCodeMobile-solving-Java-algorithms>git checkout -b "git_lesson"

Git checkout -  : This takes you to the previous branch.

C:\Users\Public\WWCode Git\WWCodeMobile-solving-Java-algorithms>git branch -d git_lesson

Checking out to GitHub Commands

Git push origin branch_name – this helps push changes to branches, in this case we will be pushing the changes we've made in "git_lesson"

C:\Users\Public\WWCode Git\WWCodeMobile-solving-Java-algorithms>git push origin git_lesson

Checked out Branch pushed to GitHub 

Git pull – this pull any changes done on master repository or branch. In this case we will submit a pull request from "git_lesson" on GitHub and once approved on GitHub we can switch back to our local and pull changes from merged branch

•Git log – shows full change history

•Git merge – this merges branch 

C:\Users\Public\WWCode Git\WWCodeMobile-solving-Java-algorithms>git merge master
Already up to date.
// you merge master into your branch if you have a team member who was working on a different task and his work was approved to master.

•Git push – pushes local changes to origin.

Summary

 

Git has many commands you can visit Git Link for more commands.

 

Thank you , and if you have any question reach out to me here.

 

Twitter : @madona_syombua

GitHub : @madonahs

Git and Github: Source Control Basics and Advanced Techniques

By Madona Syombua

Git and Github: Source Control Basics and Advanced Techniques

Source control is an essential skill for any software developer to manage their code base, keep track of changes, and coordinate major revisions with other team members. Git is the fastest growing open source version control system today. Educator: Madona Syombua | Android Engineer, Founder of Budgeting Buddy, Grow with Google Recipient, WWCode Mobile Android Lead Twitter: @madona_syombua GitHub: @madonahs

  • 983