GitHub ReportAdvanced Software EngineeringSubmitted by:Manesh Shanker Vaswani [email protected]
orgCourse Instructor:Sir Irfan [email protected]’ DeclarationI solemnly declare that the content presented in this report has been written out solely byme with no significant help from any other person. I confirm that no portion of my reporthas been plagiarized and references of the material used in this report are also provided.………………………………………………………Manesh Shanker VaswaniKamp-Lintfort, GermanyJanuary 12, 20182OverviewThe purpose of this report is to yield the primitive knowledge on GitHub. This reportprovides a brief description on open source version controlling system and its cloudrepositories. While it states a brief difference between Git and GitHub, it also explains thestructure, usage and key concepts of Git and GitHub. Examples and sample snippets ofcode are also presented in order to support the purpose.
Goals1. Getting acquainted with key concepts and workflows of Git and GitHub.2. A guide to getting started with Git and GitHub.
Definitions:GitIt is an open source version control system with command line management, providing thetracking of changes made to the source. It also provides the facility to sync with cloud,hence supporting collaborative development and maintaining version history.GitHubIt is a graphical user interface for cloud based Git services and an online repositoryprovider.Foundations:1. Git was started in 2005 and was created by creator of Linux (Linus Torvalds)2. GitHub was founded in 2008 by Tom Preston-WernerKey Concepts of GitSnapshotSnapshot is the state or content of the source code at a specific point in time.3CommitThe act of registering a snapshot that records changes to the repository is known ascommit.
Every snapshot has to be committed in order to be added to centralized sourcecode.RepositoryThe collection of all commits (Local or Remote) is known as repository. This is where thesource code resides. The repositories can be centralized and decentralized.PushPush is the method to add local repository changes to the remote repository.
CloneThe act of copying a remote repository to a local machine is termed as clone.CheckoutGetting the desired/intermediate version of the repository is often termed as checkout, it isused to get the desired snapshots of the source code.BranchBranch is an independent line of development. New features are very likely to be deployedand developed in an independent branch. Only after the approval of these features, thisbranch is merged with the main branch of Git.Master BranchIt is the default branch of the project in Git.
All other branches are required to be mergedwith this branch as this branch is supposed to be the main branch having complete sourcecode.PullPull is used to request the local changes to be indulged within the remote repository.MergeMerge is an action of merging an independent branch with the master branch.4Key Concepts of GitHubFork? Producing a personal copy of someone else’s project? Forks can make pull requests to original projectCloud storageIt provides cloud storage for online repositories, which supports collaboration within teamand also maintains an online version history.Project WikiA web page for project repositories, where the documentation and other relevantinformation about the project can be hosted.Bug TrackerAn issue tracker facility which lets developer create and assign bug labels on snippets ofcode. It also facilitates in sorting, prioritizing and searching of the issues.CommentsThis feature help in collaborating and keeping track of tracks assigned and performed bydifferent team members.
Fig 1.0: A pictorial representation of fork, pull and merge of a master branch on GitHub5WorkflowFig 2.0: A pictorial representation of workflow of GitWorking DirectoryThis is the project directory on the local storage of the developer. All initial modificationswithin the source code remain the working directory, elaborated in Fig 2.1.
Each teammember has his/her own working directory which is not implicitly synchronized withothers. Any changes made to the code in the working directory has no impact on thefunctionality of the project unless it is explicitly synchronized with local or cloud repository.Staging AreaThe Git add operation moves the source code from working directory into staging area. Asrepresented Fig 2.2, this is where the modifications made to code in the working directoryare analyzed and compared with repository. Here the changed snippets of the source codeis prepared to be integrated with the repository.Git RepositoryThis can be a local or a centralized cloud repository where the master branch of sourcecode resides.
All the individual changes made by the developers in their respective workingdirectories are supposed to be committed within Git repository in order to synchronize thesource code and functionality of the project among all, see Fig 2.3.6Fig 2.1:Files are modified in working directoryFig 2.
2:Snapshots are made and prepared to becommitted.Fig 2.3:Committed snapshots are storedpermanently in to the repository7Getting StartedSetupDownload and Install Git/Git Bash: https://git-scm.com/downloadsMake GitHub account: https://github.com/joinSample Project on GitHubCreate an online repository on GitHub:1. Login to GitHub and click on the right top drop down menu on the home page andselect ‘New Repository’, see Fig 3.0,2.
Setup the online GitHub repository, see Fig 3.1.Create the project and push it to the online repository:Note: Type all commands in Git Bash1. Create Project Directory:mkdir “Hello World”cd “Hello World”2.
Initialize a local Git repository:git init3. Create a webpage and save it in the project folder:4. Add index.html to the staging area:git add index .
html5. Commit the changes to the local Git repository:git commit – m “first commit”6. Connect and push it to the online GitHub repository (use link to your repository)git remote add origin https://github.com/userId/HelloWorld.gitgit push – u origin master8Fig 3.0: Create new repository on GitHubFig 3.
1: Setup new repository on GitHub9References1. https://git-scm.com/2. https://guides.