{"id":46,"date":"2013-09-19T17:11:00","date_gmt":"2013-09-19T17:11:00","guid":{"rendered":"http:\/\/ashokaon.tech\/?p=46"},"modified":"2020-07-17T01:10:29","modified_gmt":"2020-07-16T19:40:29","slug":"quick-and-easy-way-to-get-started-with-git-github-a-step-by-step-guide","status":"publish","type":"post","link":"https:\/\/ashokaon.tech\/blog\/quick-and-easy-way-to-get-started-with-git-github-a-step-by-step-guide\/","title":{"rendered":"Quick and easy way to get started with Git &#038; GitHub &#8211; a step-by-step guide"},"content":{"rendered":"<p><span style=\"font-size: 10px;background-color:#FFFF99;display:block\">(Note: This blog post was originally published under my old domain(codesmiles.com), <a href=\"http:\/\/codesmiles.com\/post\/getting-started-in-Git-and-GitHub.aspx\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>. <a href=\"https:\/\/web.archive.org\/web\/2013*\/http:\/\/codesmiles.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Web Archive link<\/a>.<\/span><\/p>\n<p><span style=\"font-size: 10px;\">(This is an accompanying text article for the <a href=\"http:\/\/www.slideshare.net\/ashoka_rkt\/quick-and-easy-way-to-get-started-with-git-github\" target=\"_blank\" rel=\"noopener noreferrer\">session<\/a> I&#8217;ll be taking at <a href=\"http:\/\/www.dotnetcbe.com\" target=\"_blank\" rel=\"noopener noreferrer\">Coimbatore .NET User Group<\/a> this weekend)<\/span><\/p>\n<p>In this fast paced post I will write about the simplest and quickest set of steps needed for getting started in Git &amp; GitHub. Ultimately the aim of the post is to give a good essential idea of Git &amp; GitHub ignoring whatever IMHO is not needed for anyone who is trying to get started, my aim is to make sure the reader could read &amp; understand this post in 20 minutes or less. Also GitHub for windows has made things easier and I thought of spreading the word about it from my side.<\/p>\n<p>In this post:<\/p>\n<ul>\n<li>I will talk a little about the concepts of Git &amp; GitHub<\/li>\n<li>How to use \u201cGitHub for Windows\u201d and setup a GitHub based distributed source control system(if you are a non windows user, then still you\u2019ll be able to learn the way Git &amp; GitHub works from this post)<\/li>\n<li>How Open Source projects on GitHub works<\/li>\n<\/ul>\n<p>Before proceeding, I would like to tell you that using Git via command line is not so easy and has at least a tiny learning curve, but it is powerful. For developers who have used other popular source control systems this maybe bit difficult, so I thought of writing this blog post showing how simple it is to use GitHub windows application and simplify Git based SCM.<\/p>\n<h2 class=\"h2subtop\">What is Git? <a class=\"subtoplink\" title=\"Permalink to this headline\" href=\"#What-is-Git\">\u00b6<\/a><\/h2>\n<p>Git is a Distributed Revision Control System. It is developed by Linus Torvalds, creator of Linux. Git is used by many popular open source projects, I came to know because of many .NET open source projects, so it is not a Non-.NET\/Microsoft kind of thing. Git\u2019s performance is very high and it is its Unique <em>Selling<\/em>\u00a0 Point(but it\u2019s <em>free<\/em> <img decoding=\"async\" class=\"wlEmoticon wlEmoticon-winkingsmile\" style=\"border-style: none;\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/wlEmoticon-winkingsmile.png\" alt=\"Winking smile\" \/>).<\/p>\n<p>Git is primarily a CUI based system but there are tools to do GUI based interaction.<\/p>\n<h2 class=\"h2subtop\">Why Distributed? <a class=\"subtoplink\" title=\"Permalink to this headline\" href=\"#Why-Distributed\">\u00b6<\/a><\/h2>\n<p>In short..<\/p>\n<ul>\n<li>Repository is present in all clients where it is cloned, so server crash isn\u2019t a problem<\/li>\n<li>Each clone is a full repository, it contains all the code and version history<\/li>\n<li>Provides several new workflows where it gets easier to isolate each user\u2019s changes and easy to integrate changes of all the users, more info on various distributed workflows is <a href=\"http:\/\/git-scm.com\/book\/en\/Distributed-Git-Distributed-Workflows\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/li>\n<\/ul>\n<p><span style=\"font-family: verdana;\">More about distributed version control systems <a href=\"http:\/\/en.wikipedia.org\/wiki\/Distributed_revision_control\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/span><\/p>\n<h2 class=\"h2subtop\">The Git &amp; GitHub Jargon <a class=\"subtoplink\" title=\"Permalink to this headline\" href=\"#gitjargon\">\u00b6<\/a><\/h2>\n<p>Git\u2019s workflow may feel strange or uncomfortable initially for many developers who got used to working in other version control systems, for instance, there is no word called check-in or check-out in Git.<\/p>\n<p>So I would suggest that you understand the below terms before trying to use Git\/GitHub to avoid confusion.<\/p>\n<ul>\n<li><strong>repo<\/strong> \u2013 repository \u2013 where your files and version history of them are stored<\/li>\n<li><strong>pull<\/strong> \u2013 pulling code from a repository(public\/online) to your repository<\/li>\n<li><strong>push<\/strong> \u2013 pushing your changes to a repository, this is not the equivalent of check in, but it is Step 1 of the git\u2019s way of check in<\/li>\n<li><strong>commit<\/strong> \u2013 commit the pushed changes, second &amp; last step of the git\u2019s way of check in<\/li>\n<li><strong>staged changes<\/strong> \u2013 changes that are pushed to a repository but not yet committed<\/li>\n<li><strong>clone<\/strong> \u2013 create a copy of the whole repository along with version history etc, brings the whole version control system\u2019s stuff to this clone, this is a general term in several other version control systems<\/li>\n<li><strong>fork<\/strong> \u2013 forking creates a copy of a repository and provides a way for you to isolate your changes, there are provisions to merge your changes later into the actual repository(main repository\/source repository)<\/li>\n<li><strong>pull request<\/strong> \u2013 you send a pull request so that the main repository admin will know that there are changes that you have done in your fork(your version of the repository) and you would like the admin to pull your changes and merge them with the main repository if she\/he thinks it is fine<\/li>\n<li><strong>pull vs pull-request<\/strong> \u2013 pull is generally used when you pull files from a repository, but pull request comes into picture only if your <a href=\"http:\/\/git-scm.com\/book\/en\/Distributed-Git-Distributed-Workflows\" target=\"_blank\" rel=\"noopener noreferrer\">workflow<\/a> involves forking<\/li>\n<li><strong>merge<\/strong> <strong>pull-request to main repo<\/strong> \u2013 as said earlier, this means that the admin of the actual repository from which you forked will receive a pull request and will review the changed\/added files and then merge them with the actual repository<\/li>\n<\/ul>\n<h2 class=\"h2subtop\">Creating Repositories <a class=\"subtoplink\" title=\"Permalink to this headline\" href=\"#Creating-Repositories\">\u00b6<\/a><\/h2>\n<p>After you create an account in GitHub and sign in, you will have a button named New repository, click it to create a new repository on GitHub server.<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_2.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_2.png\" alt=\"image\" width=\"341\" height=\"103\" border=\"0\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Provide necessary inputs as prompted.<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_19.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_19.png\" alt=\"image\" width=\"642\" height=\"431\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<h2 class=\"h2subtop\">Setting up your system to work with GitHub <a class=\"subtoplink\" title=\"Permalink to this headline\" href=\"#Setting-up-your-system-to-work-with-GitHub\">\u00b6<\/a><\/h2>\n<p>Before proceeding, go to <a href=\"http:\/\/windows.github.com\" target=\"_blank\" rel=\"noopener noreferrer\">windows.github.com<\/a> and download and install the GitHub windows application.<\/p>\n<p>Note that, up to my analysis, the GitHub for Windows application can be used with any git setup not just GitHub.<\/p>\n<p>For easy reading I will use \u201cGitHub\u201d instead of \u201cGit\/GitHub\u201d henceforth.<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_1.png\" alt=\"image\" width=\"640\" height=\"398\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<h2 class=\"h2subtop\">In GitHub.com\u2026 <a class=\"subtoplink\" title=\"Permalink to this headline\" href=\"#In-GitHub-com\">\u00b6<\/a><\/h2>\n<p>Once you create a repository as shown earlier, below screen will be shown.<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_4.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_4.png\" alt=\"image\" width=\"642\" height=\"339\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<p>Note that it has the URL of your public online repository and a button named \u201c<strong>Set up in Desktop<\/strong>\u201d and help information on how to use command line interface to setup your machine to point to this repository. The next time you want to clone a repository, you go to its main URL and click the \u201c<strong>Clone in Desktop<\/strong>\u201d button as shown below.<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/ScreenHunter_170%20Sep.%2030%2000.08%20-%20Copy.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"ScreenHunter_170 Sep. 30 00.08 - Copy\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/ScreenHunter_170%20Sep.%2030%2000.08%20-%20Copy_thumb.jpg\" alt=\"ScreenHunter_170 Sep. 30 00.08 - Copy\" width=\"642\" height=\"347\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<p>Now you can click \u201c<strong>Set up in Desktop<\/strong>\u201d, you will get the below prompt..<\/p>\n<p><strong><span style=\"background-color: #cccccc;\">(Internet Explorer)<\/span><\/strong><\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/ScreenHunter_159%20Sep.%2020%2002.14.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"ScreenHunter_159 Sep. 20 02.14\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/ScreenHunter_159%20Sep.%2020%2002.14_thumb.jpg\" alt=\"ScreenHunter_159 Sep. 20 02.14\" width=\"421\" height=\"184\" border=\"0\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"background-color: #cccccc;\">(Chrome)<\/span><\/strong><\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_5.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_5.png\" alt=\"image\" width=\"642\" height=\"331\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<p>This button was not working in <strong><span style=\"background-color: #cccccc;\">Firefox<\/span><\/strong>, I don\u2019t know why.<\/p>\n<p>Once you click <strong>Launch Application<\/strong> or <strong>Allow<\/strong> based on the browser you are using, GitHub windows application will be launched for you and if you have launched the application some time before and logged in to it then automatically the repo will be cloned, but I will show you the other way of what happens for the first time, when you have never used GitHub for windows.<\/p>\n<h2 class=\"h2subtop\">Using GitHub for Windows <a class=\"subtoplink\" title=\"Permalink to this headline\" href=\"#Using-GitHub-for-Windows\">\u00b6<\/a><\/h2>\n<p>After the GitHub windows application is launched you should login to it with your GitHub credentials<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_6.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_6.png\" alt=\"image\" width=\"644\" height=\"355\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<p>After logging in, below screen will be shown to configure the user information, user information is used for your commits as explained in the screen.<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_7.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_7.png\" alt=\"image\" width=\"369\" height=\"242\" border=\"0\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>After initial setup, GitHub for Windows shows the below screen, which shows the local and github\u2019s online repositories linked to this user.<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_9.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_9.png\" alt=\"image\" width=\"644\" height=\"355\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<p>GitHub for Windows\u2019 Options screen lets you configure various settings as shown below, you might want to take a look at this before proceeding.<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_10.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_10.png\" alt=\"image\" width=\"644\" height=\"355\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<p>To access your GitHub repositories select github on the left section of the screen, which lists the online repositories you have. You can clone a particular repository as shown below, it will be cloned to the directory configured in the <strong>Options<\/strong> screen shown above.<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_11.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_11.png\" alt=\"image\" width=\"644\" height=\"122\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<p>You can open the files\u2019 location in explorer as shown below.<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_12.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_12.png\" alt=\"image\" width=\"644\" height=\"125\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"background-color: #a5a5a5;\">I have created couple of files in this location as shown below. Now let\u2019s see how we can move these files to the online GitHub repository, I mean Git\u2019s way of checking-in.<\/span><\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_13.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_13.png\" alt=\"image\" width=\"414\" height=\"189\" border=\"0\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>GitHub windows application automatically detects that the repository is changed and shows the below screen. Now you can type a commit message and click commit as shown below.<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_14.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_14.png\" alt=\"image\" width=\"644\" height=\"189\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Next, you can see that the commit you just made is not yet published(pushed) to the GitHub server, click the <strong>publish <\/strong>button to publish the changes.<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_15.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_15.png\" alt=\"image\" width=\"644\" height=\"355\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Files are now pushed to GitHub server as shown below.<\/p>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_16.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_16.png\" alt=\"image\" width=\"644\" height=\"345\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2 class=\"h2subtop\">Publish &amp; Sync Vs. Push &amp; Pull <a class=\"subtoplink\" title=\"Permalink to this headline\" href=\"#Publish-and-Sync-Vs-Push-and-Pull\">\u00b6<\/a><\/h2>\n<p>I noticed that first time if files are added to a repository the above shown <strong>publish <\/strong>button is displayed. If the files are modified later in your local repository or if someone else modifies the files and commits them to the server, meaning whenever your local repo changes or whenever server repo changes, then the publish button becomes a <strong>sync <\/strong>button.<\/p>\n<p>So, the <strong>sync<\/strong> button does two things..<\/p>\n<ul>\n<li>Pushes changes you made in your local repository to github server<\/li>\n<li>Pulls changes committed to the server by other users to your local repo<\/li>\n<\/ul>\n<p><a href=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_17.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/image_thumb_17.png\" alt=\"image\" width=\"644\" height=\"155\" border=\"0\" \/><\/a><\/p>\n<p><span style=\"font-size: xx-small;\">(click to enlarge)<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2 class=\"h2subtop\">Two Most Popular Collaborative Development Workflows in GitHub <a class=\"subtoplink\" title=\"Permalink to this headline\" href=\"#Two-Most-Popular-Collaborative-Development-Workflows-in-GitHub\">\u00b6<\/a><\/h2>\n<p>Even though GitHub supports several workflows as discussed <a href=\"http:\/\/git-scm.com\/book\/en\/Distributed-Git-Distributed-Workflows\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>. IMHO, I think there are two most popular workflows.<\/p>\n<ol>\n<li>General Collaborative Development \u2013 Single shared repository<\/li>\n<li>Collaborative Development in Public Repos\/Open Source projects \u2013 involving Fork &amp; Pull Requests<\/li>\n<\/ol>\n<h2 class=\"h2subtop\">Workflow 1 &#8211; General Collaborative Development <a class=\"subtoplink\" title=\"Permalink to this headline\" href=\"#Workflow-1---General-Collaborative-Development\">\u00b6<\/a><\/h2>\n<p>A shared single repository with access permissions for users is setup, users can pull and push changes, we just saw above how you change your local repo and push(sync) with the online repo.<\/p>\n<h2 class=\"h2subtop\">Workflow 2 &#8211; Collaborative Development in Public repos\/Open Source projects \u2013 involving Fork &amp; Pull Requests <a class=\"subtoplink\" title=\"Permalink to this headline\" href=\"#Workflow-2---Collaborative-Development-in-Public-repos\/Open-Source-projects-\u2013-involving-Fork-and-Pull-Requests\">\u00b6<\/a><\/h2>\n<p>In many open source projects people collaborate using this workflow in GitHub. This is not as complex as it sounds, just quickly review the jargon section again, now you should be clear about what is <strong>Fork<\/strong> and <strong>Pull request<\/strong>.<\/p>\n<p>In general forking provides below benefits:<\/p>\n<p>\u2013 Makes your own repo called a fork<\/p>\n<p>\u2013 Provides freedom to change your version of the repo<\/p>\n<p>\u2013 Isolated from the main repo<\/p>\n<p>The below figure explains what happens in this workflow.<\/p>\n<p>1. You Fork the Main repo, this creates your version of Main repo\u2019s files; your version of the repository, <strong>your Fork<\/strong>.<\/p>\n<p>2. You Make changes \u2013 Add\/modify files and commit these changes<\/p>\n<p>3. You send Pull request to the main repo which goes to the main repo admin<\/p>\n<p>4. Main Repo admin reviews the code changes and accepts &amp; merges your pull request<\/p>\n<p><span style=\"font-size: xx-small; background-color: #ffff00;\">(sorry for the site name in the middle of the image, it is NOT for promo purposes, but just an attempt to stop plagiarism)<\/span><\/p>\n<p><a href=\"#stopanimation\">Hide\/Show animation<\/a><\/p>\n<div id=\"gifimg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"Fork-Pull-RequestStill6\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/Fork-Pull-RequestStill6.gif\" alt=\"Fork-Pull-RequestStill6\" width=\"700\" height=\"615\" border=\"0\" \/><\/div>\n<div id=\"stillimg\" style=\"display: none;\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;\" title=\"Fork-Pull-RequestStill6\" src=\"http:\/\/ashokaon.tech\/blog\/wp-content\/uploads\/Fork-Pull-RequestStill6.png\" alt=\"Fork-Pull-RequestStill6\" width=\"700\" height=\"615\" border=\"0\" \/><\/div>\n<p>&nbsp;<\/p>\n<h2>Conclusion<\/h2>\n<p>In this post, I gave an introduction to Git and how distributed SCM could help you. Then we saw the jargons in Git &amp; GitHub and we setup our system to work with GitHub and then created a repository in GitHub.com. Then, we used the GitHub windows application and cloned the GitHub repository and worked with it. Lastly we saw the collaborative development workflows and most importantly how open source projects work in GitHub.<\/p>\n<p>I hope I have given enough information for you to get started in Git &amp; GitHub.<\/p>\n<p>Happy Coding!<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>In this fast paced post I will write about the simplest and quickest set of steps needed for getting started in Git &#038; GitHub. Ultimately the aim of the post is to give a good essential idea of Git &#038; GitHub ignoring whatever IMHO is not needed for anyone who is trying to get started, my aim is to make sure the reader could read &#038; understand this post in 20 minutes or less.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[6,7,9],"_links":{"self":[{"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/posts\/46"}],"collection":[{"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/comments?post=46"}],"version-history":[{"count":4,"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/posts\/46\/revisions"}],"predecessor-version":[{"id":277,"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/posts\/46\/revisions\/277"}],"wp:attachment":[{"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/media?parent=46"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/categories?post=46"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ashokaon.tech\/blog\/wp-json\/wp\/v2\/tags?post=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}