diff --git a/README.md b/README.md index 9cb54a9..8eab115 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,173 @@ -# SE-Assignment-4 -Assignment: GitHub and Visual Studio -Instructions: -Answer the following questions based on your understanding of GitHub and Visual Studio. Provide detailed explanations and examples where appropriate. +Assignment: GitHub and Visual Studio Instructions: Answer the following questions based on your understanding of GitHub and Visual Studio. Provide detailed explanations and examples where appropriate. -Questions: -Introduction to GitHub: +Questions: Introduction to GitHub: -What is GitHub, and what are its primary functions and features? Explain how it supports collaborative software development. -Repositories on GitHub: +What is GitHub, and what are its primary functions and features? Explain how it supports collaborative software development. Repositories on GitHub: -What is a GitHub repository? Describe how to create a new repository and the essential elements that should be included in it. -Version Control with Git: +GitHub is a web-based platform that provides hosting for software development version control using Git. It is also used by developers to store, share and collaborate on projects, manage code and track changes over time. -Explain the concept of version control in the context of Git. How does GitHub enhance version control for developers? -Branching and Merging in GitHub: -What are branches in GitHub, and why are they important? Describe the process of creating a branch, making changes, and merging it back into the main branch. +1. Version control: Being built on Git, it allows developers to track changes to their codebase over time and revert to previous versions. +2. Repositories: It has repositories where you store your projects, files and history. It comes with a README that describe the project, installation steps and other important details. +3. Branches: It allows developers to create branches which enables them to work on different featuresin isolation then after the changes are done merge back with the main code. +4. Pull request: It is a way t propose chages to the project. A developer can open a pull request to have their changes reviewed by others. +5. Collaborative features: They include; issues which allows developers to report bugs or discuss other topics related to the project, project boards which allows developers to organize tasks ortrack projectsand wisk which allows developers to decument their project in more detail. +6. Actions and CI/CD: It allows to automate taskslike running tests, deployment of code and more. +7. Code hosting/sharing: It hosts your code in the cloud allowing for your collaborators to access it from anywhere. +8. Forking: It allows one to create a copy of someone else's project under their own GitHub account. +9. Community and social features: It provides tools to engage with the open-source community through their repositories, discussions and contributions. + +How GitHub supports collaboration and software development + +1. By usig braches and pull requests, it eables multiple developers to work on the same project without overwritting each other's work. +2. Pull requests allow team members to review and discuss code before it is merged to their main codebase +3. The built-in issue tracker and project boards help teams manage tasks, bugs and feature requests. +4. Continous intergration and deployment: GitHub makes it possible to automate testing, building and deployment of code whenevr the changes are made. +5. Open source contribution: It i home to millios of open-source projects enabling developersfrom all over the worls to collaborate. + +What is a GitHub repository? Describe how to create a new repository and the essential elements that should be included in it. Version Control with Git: + +A GitHub repository is a storage space for a project where all the files, code and history related to that project are kept. It can either be public or private. + +How to create a repository + +1. Log in to your GitHub account. +2. Fill in the repository details which include repository name,description, public or private, initialize repository then click create repository. + +Explain the concept of version control in the context of Git. How does GitHub enhance version control for developers? + +Version control is a system that tracks the chages to files over time enabling developers to manage and organize their codebase efficiently. +Git is a distributed version control system that manages changes to files and directories in a project. + +How GitHub enhances version control for developers + +1. Remote repository hosting: The repositories being in the cloud makes it easy for developers to collaborate on projects from different locations. +2. Collaboration by pull request: It allows developers to propose changes to the codebase. Once done with the changes, you create a pull request to merge their changes to another branch. +3. Code reviews and discussions: The pull request feature includes tools for code review. It helps maintain coding standards, catch errors early and promote knowledge sharing within the team. +4. Issue tracking and project management: It enables teams to manage bugs, feature requests and tasks directly within the repository. It also provides tools that help organize taska and track progress. +5. GitHub and CI/CD: GitHub provides features that allow automation of workflows. Automation helps make sure that the code is always in a deployable state. +6. Forking and open-source contribution: It makes it easy for developers to make changes to the original project. This encourage collaboration by other developers on projects they didn't start themselves. +7. Security and permissions: GitHub allows you to manage permissions at the repository level making sure only authorized users can make changes. Branching and Merging in GitHub: + +What are branches in GitHub, and why are they important? Describe the process of creating a branch, making changes, and merging it back into the main branch. + +Branches are isolated copies of your codebase that allow you to work on new features, bug fixes or experiments without affecting the main code. + +Importance of branches + +1) Branches allow you to work on isolation to develop new features, fix bugs or experiment without affecting the stable version. +2) Multiple workers can work on different branches simultaneously which makes collaboration easier and reduces conflict since everyone is working on their own isolated copy. +3) It makes it safe if you want to experiment new features. If they dont work out you can delete the branch without affecting the project. +4) Braches allow developers to submit their changes via pull request which allows team members to review the code before being merged to th main project. +5) They provide a structured workflow which help keep your project organized and manageable. + + Process of creating a branch, making changes and merging to main branch using the command line +1. On your terminal navigate to your repository directory. +2. Create a new branch with "git checkout -b my-new-branch" command +3. After making changes, stage them using 'git add .' command. +4. Commit the changes with a message describing what you have done using 'git commit -m "message" command +5. Push your changes to GitHub using 'git push origin my-new-branch' +6. On GitHub navigate to the repository and click on compare and pull request. +7. Make sure the base branch is 'main' and compare branch is 'my-new-branch' then click the pull request. +8. After the review process, type 'git checkout main' then 'git merge my-new-branch' then 'git push origin main/master' +9. Finally delete the branch (optional) using 'git branch -d my-new-branch' + Pull Requests and Code Reviews: -What is a pull request in GitHub, and how does it facilitate code reviews and collaboration? Outline the steps to create and review a pull request. -GitHub Actions: +What is a pull request in GitHub, and how does it facilitate code reviews and collaboration? Outline the steps to create and review a pull request. + +A pull request is a feature that facilitates collaboration by allowing developers to propose changes to a codebase. + +Pull reuests facilitate code reviews and collaboration in the following ways: + +1. They allow the developers to review the proposed changes before they are merged. The review process ensures the code is high quality, free from bugs and adheres to project guidelines. +2. They provide a space for developers to discuss the changes ask questions and clarify the intention of the code. +3. They allow multiple developers to collaborate on the same codebase. +4. Pull requests trigger automated tests and CI pipelines to ensure the new code intergrates well with the existing codebase and doesn't introduce new bugs. +Steps to create and review a pull request + +1. Push your changes to GitHub using 'git push origin my-branch' command +2. Navigate to the repository on GitHub +3. Click on the compare and pull request prompt and navigate to the new pull request and click new request. +4. In PR interface, select the base branch and compare it to the branch. +5. Add a description and submit the request. +6. The review is done and changes are approved. +7. Once the reviews are done, the pull request can be merged to the main branch. + + GitHub Actions: Explain what GitHub Actions are and how they can be used to automate workflows. Provide an example of a simple CI/CD pipeline using GitHub Actions. + +GitHub Actions is an automation platform provided by GitHub that allows developers to automate workflows directly in their GitHub repositories. + +How GitHub actions can be used to automate workflows. + +1. Automatically running unit tests whenever the code is pushed or when a pull request is created. +2. Building your application to ensure that changes don't break the building process. +3. Automating the deployment of applications to environments like production. +4. Automatically checking code for linting errors or format code according to predefined rules. +5. Sending notifications based on workflow outcomes or successful deploymets. + Introduction to Visual Studio: -What is Visual Studio, and what are its key features? How does it differ from Visual Studio Code? +What is Visual Studio, and what are its key features? How does it differ from Visual Studio Code? + +Visual studio is an integrated development environment designed for creating applications across various platforms. It is used by professional developers to build large scale applications. + +Key features of Visual Studio + +1. Comprehensive Development Environments: It contains a complete set of tools for writing, editing and deploying code. +2. Project and solution management: It uses a project and solution system to organize code and resources. +3. Advanced debugging tools: It offers powerful debugging feature such as call stack inspection. +4. Intergrated testing tools: It has built-in tools for unit testing, load testing and automated testing. +5. IntelliSense and code refactoring: ItelliSense is a feature that suggests code as you type, helping developers write code with fewer errors. Refactoring tools help improve the code structure without changing its behavior. +6. Visual designer tools: It is helpful when developing desktop or mobile applications. +7. Integration with Azure: It has in-built support for azure enabling developers to easily create, deploy and manage cloud applications. + +Visual studio is a powerful, full-featured IDE for building large-scale applications with extensive built-in tools for debugging, testing and deployment while visual studio code is a lightweight, extensible code editor that is fast and flexible, popular for web development and scripting tasks. + Integrating GitHub with Visual Studio: Describe the steps to integrate a GitHub repository with Visual Studio. How does this integration enhance the development workflow? + +Steps to integrate GitHub repository with VS +You have to ha first installed Visual studio and have a GitHub account. + +1.Open visual studio +2.Click on account settings. +3.Under all accounts click add account and choose GitHub. + +How ntegration enhances the development workflow. + +1. Developers can manage their source control directly from the IDE +2. It provides an intuitive interface for creating, switching and managing branches. +3. It provides a rich graphical interface for Git makingit easier for developers to visualize branch histories, track changes and manage code with less reliance on command line. +4. It supports real-time collaboration tools allowing developers to code together in the same repository in real-time. + Debugging in Visual Studio: -Explain the debugging tools available in Visual Studio. How can developers use these tools to identify and fix issues in their code? +Explain the debugging tools available in Visual Studio. How can developers use these tools to identify and fix issues in their code? Key debugging tools in VS + +1. Breakpoints: They allow developers to pause the execution of their condition at a specific line or a condition. +2. Step into, step over and step out: They are step-through debugging commands that let you control the execution of your code one line at a time. +3. Wantch window: It allows you to track the value of variables or complex expressions during debugging. +4. Remote debugging: It allows you to debug an application running on another machine or environment, such as a remote server, a virtual machine, or a Docker container. +5. Memory and performance profiling: Visual Studio includes profiling tools that allow developers to analyze memory usage, CPU performance, and application responsiveness. These tools help identify performance bottlenecks and memory leaks. +6. IntelliTrace: it is a feature in Visual Studio Enterprise that captures a history of application events and state, allowing you to "go back in time" during debugging. + Collaborative Development using GitHub and Visual Studio: Discuss how GitHub and Visual Studio can be used together to support collaborative development. Provide a real-world example of a project that benefits from this integration. +Using GitHub and Visual Studio together provides a powerful platform for collaborative software development. GitHub's repository management, branching, pull requests, and CI/CD capabilities combine with Visual Studio's advanced development and debugging tools to create an efficient and streamlined development workflow. + +How VS and GitHub integration supports collaboration +1. Central repository: The ASP.NET Core project has a central repository on GitHub that serves as the single source of truth for the entire codebase. Developers clone this repository using Visual Studio and create branches to work on new features or bug fixes. +2. Branching strategy: Each new feature or bug fix is developed in a separate branch, which is managed using Git. Visual Studio provides tools to create, switch, and merge branches. This ensures that each developer works independently without interfering with others' work. +3. Pull requests and code reviews: When a developer completes a feature, they create a pull request on GitHub. The core team reviews the pull request, provides feedback, and approves it once the code meets the project's standards. Visual Studio allows developers to view and manage pull requests, streamlining the process of contributing to the project. +4. Automated testing and CI/CD: GitHub Actions is used to automate testing and deployment for the ASP.NET Core project. When a developer pushes code from Visual Studio, GitHub Actions automatically runs the test suite to ensure that the changes do not introduce new bugs. If the tests pass, the code is merged, and deployment processes can be triggered automatically. +5. Issue tracking and task management: GitHub's issue tracking system helps the ASP.NET Core team manage incoming bug reports and feature requests. Developers can reference specific issues in their commits, and when the pull request is merged, the related issues are automatically closed. This ensures that the project's progress is visible and that all work is tracked properly. +6. Community contributions: The open-source nature of the ASP.NET Core project means that contributors from outside Microsoft can submit changes. GitHub makes it easy for external contributors to fork the repository, make changes using Visual Studio, and submit pull requests back to the main project. The maintainers can then review, test, and merge these contributions. +7. Real-world example Project: ASP.NET Core by Microsoft. It is an open-source web framework developed by Microsoft for building modern, cloud-based, internet-connected applications. -Submission Guidelines: -Your answers should be well-structured, concise, and to the point. -Provide real-world examples or case studies wherever possible. -Cite any references or sources you use in your answers. -Submit your completed assignment by [due date]. +Submission Guidelines: Your answers should be well-structured, concise, and to the point. Provide real-world examples or case studies wherever possible. Cite any references or sources you use in your answers. Submit your completed assignment by [due date].