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:
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
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.
Twitter : @madona_syombua
GitHub : @madonahs