1 / 40

OpenForge How To…

OpenForge How To…. User Registration https://openforge.gov.in. User Registration https://openforge.gov.in. You will receive a verification email on your registered mail Id. Click on the verification link to validate the registration. Once validated login to OpenForge.

Télécharger la présentation

OpenForge How To…

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OpenForge How To…

  2. User Registrationhttps://openforge.gov.in

  3. User Registrationhttps://openforge.gov.in • You will receive a verification email on your registered mail Id. • Click on the verification link to validate the registration • Once validated login to OpenForge • Make Sure to select Account type as Individual • Click on Register New Project

  4. Project Registrationhttps://openforge.gov.in • Fill the details on the project registration page • Select Private Project • Click on agree to Policiy

  5. Adding Project Membershttps://openforge.gov.in Add users to project Add NIC Coordinators to the project as per instructions . Click on User Permissions

  6. Project Users Rightshttps://openforge.gov.in NOTE:- Provide admin rights to NIC Coordinator(s).

  7. OpenForge Boot Camp on GIT

  8. GIT – Introduction • Version Control ? - Version control systems are a category of software tools that help a software team manage changes to source code over time. • What is GIT? - By far, the most widely used modern version control system in the world today is Git. Git is a mature, actively maintained open source project originally developed in 2005 • Why GIT? - Relying on software for mission-critical applications, altering your development workflow impacts your entire business. Git isn’t just for agile software development—it’s for agile business. • Install GIT – Visit https://git-scm.com/downloads & follow steps to download/install according to respective Operating System (OS). • GIT Cheat Sheet - https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet or Refer GIT Documentation - https://git-scm.com/doc

  9. GIT Fundamentals – Local Workflow

  10. GIT Fundamentals - First Time Setup • git --version  to check if git is successfully installedgit version 2.9.0.windows.1 • Set config values  git config --global user.name “<Your Name>”git config --global user.email “<YourEmail@abc.com>” • Get config values git config --list • GIT Help git help <verb>git <verb> --helpe.g.:git help configgit config --help

  11. GIT Version & Config List

  12. GIT Fundamentals – Getting Started 1st Scenario • 1st Scenario – Initialize from Existing Codegit initInitialized empty Git repository in /your/working/directory/path/.git/ • Check Status:git status • Add GITIGNORE – To ignore personal preferences files like configurations, Database parameters, folders, etc.just create .gitignorefile and add your preferences:.project .settings/ *.zip

  13. GIT init, status & gitignore Before without .gitignore After adding preferences to .gitignore

  14. GIT Fundamentals – Adding & Committing • Start adding your changing to staging area:git add -A : To add all filesgit add /path/to/file.ext: To add a specific file • Check using git status • Remove file from staging area:git reset : To remove all filesgit reset /path/to/file.ext: To remove specific file • Our 1st Commit:git commit –m “Your ComitMessge”  To Commit using proper Messagegit commit --amend –m “Your Commit Message” To Rectify Commit • Use git log to see summary about commit which provides unique hash commit id, author, Date-Time of commit and Commit Message • We have now successfully tracking our local project

  15. GIT Add & Check status

  16. GIT Reset & Check status

  17. GIT Commit, Amend & Log

  18. GIT Fundamentals – Getting Started 2nd Scenario • 2nd Scenario – Cloning a Remote Repositorygit clone <url> <[where_to_clone]> • Check your working directory to see the list of Files & Folders cloned from repository. • View Information about Remote Repository:git remote -v • View Information about Remote Branch:git branch -a • Do some changes and commit your code.:git diffgit statusgit add -Agit commit –m “Your Message”

  19. GIT Clone

  20. GIT Remote Information & Branches

  21. GIT Diff

  22. GIT Add & Commit

  23. GIT Fundamentals – Push & Pull of a Repository • After committing your code it’s always a best practice to pull remote changes before pushing your code to the repository as other developers may have already sent their changes to repository.git pull <origin-name> <branch-name>git pull origin master • To push your changes to repository use git push command.git push <origin-name> <branch-name>git push origin master

  24. GIT Pull From & Push to Repository Git Pull Git Push

  25. GIT Fundamentals – Common Workflow • Create a Branch for desired featuregit branch <branch-name>git branch MyFeature@TaskID– Obtained from tracker • To List Branch:git branch* Before a branch denotes current branch • To Change Branch:git checkout <branch-name>git checkout MyFeature@TaskID • Work on your task and commit. • After commit push branch to remote:git push origin <branch-name>git push origin MyFeature@TaskID

  26. GIT Push Your Branch

  27. GIT Fundamentals – Fetch a Branch • Now the branch is available in repository for others to use for the purpose of Unit Testing, Security Testing, Code Review, etc. • There is a 2 way to fetch branch:git fetch origin MyFeature@TaskIDgit checkoutMyFeature@TaskID ORgit checkout ‐b MyFeature@TaskID git pull origin MyFeature@TaskID • After Successful Auditing of your branch, it is ready to be merged into master.

  28. GIT Fetch Branch OR

  29. GIT Fundamentals – Merge a Branch • Go to master branch:git checkout master • Pull Changes from master branchgit pull origin master • Check merge statusgit branch --merged • Merge branch into mastergit merge MyFeature@TaskID • Push changes after mergegit push origin master

  30. GIT Merge a branch

  31. GIT Branch Flow

  32. GIT Fundamentals – Merge Conflicts • Sometimes you get merge conflicts when merging into or pulling from a branch. • Merge Conflict is caused by competing line changes, such as when people make different changes to the same line of the same file on different branches in your Git repository. • To immediately get out of conflict or to resolve conflict later use:git merge --abort • Merge conflicts had to be resolved manually. But there are tools like Meld(http://meldmerge.org/) , DiffMerge(https://sourcegear.com/diffmerge/) & many other tools which makes resolving conflict easier by providing a GUI.

  33. GIT Merge Conflict in Meld

  34. GIT Fundamentals – Tag a Release • Tagging is basically versioning your release, After merging a branch mention about your changes added/removed from your software in a version management page or a simple text file.E.g. vi version.txtBootCamp 1.0.1, 31/08/2017 ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐ Features: * Added captcha in login ‐ Bugfix: * Footer issue resolved • Add you changes and commitgit add version.txtgit commit ‐m “release/1.0.1” • Tag your releasegit tag -a v1.0.1 -m "my version 1.0.1" • Push your tags to repositorygit push origin –tags • * Release management depends upon the workflow adhered by your organization, it can be before merging or after merging to master.

  35. GIT Tag a Release

  36. GIT Fundamentals – Delete a Branch • After merging of a branch we can delete the branch since it is no longer necessary • Check Merge status of a branchgit branch --merged • Delete branch locallygit branch -d MyFeature@TaskID • Check/List about Branchgit branch -a • Delete Branch from Remotegit push origin --delete MyFeature@TaskID

  37. GIT Delete Branch

  38. GIT Fundamentals – Summary • Clone a Repository • Create Branch • Do Changes (Task/Bugfix) • Add Changes to Staging • Commit Changes to Local Repository • Push Changes to Remote Repository • Merge Changes into Master • Release version using Tag • Finally Delete Branch after Merging

  39. GIT Fundamentals – References • GIT Website (https://git-scm.com/) • Atlassian Website (https://www.atlassian.com/git) • Git Tutorial for Beginners (https://www.youtube.com/watch?v=HVsySz-h9r4) • Google Images for some Pictorial Diagrams.

  40. Thank You By OpenForge Team

More Related