What’s in it for you? What’s in it for you?
What’s in it for you? Version Control System What is Git? Git Architecture Git vs GitHub Fork and Clone Collaborators Commands in Git Git Demo Branch, Merge and Rebase Distributed Version Control System
What’s in it for you? What’s in it for you?Version Control SystemVersion Control System
Version Control System (VCS) System A File 2.1File 1.1 Repository Version 2File 1 File 2 System A Now we make some changes to the files in System A File 1 ------> saved as File 1.1 File 2 ------> saved as File 2.1 The new files are stored as Version 2 in the repository VCS allows you to store multiple versions of a system file in the remote repository File 1 File 2 Version 1 All the files in System A are stored as Version 1 in the remote repository
What’s in it for you? What’s in it for you?Version Control SystemDistributed Version Control System
Distributed Version Control System Distributed VCS Developer A Developer B Developer C Version 1 Version 2 Version 3 Version 1 Version 2 Version 3 Version 1 Version 2 Version 3Version 1 Version 2 Version 3 All the developers have the entire copy of code on their local system
Distributed Version Control System Distributed VCS Developer A Developer B Developer C Version 1 Version 2 Version 3 Version 1 Version 2 Version 3 Version 1 Version 2 Version 3Version 1 Version 2 Version 3 Distributed VCS moves from client-server approach of Central VCS to peer-to-peer approach
Distributed Version Control System Distributed VCS Developer A Developer B Developer C Version 1 Version 2 Version 3 Version 1 Version 2 Version 3 Version 1 Version 2 Version 3Version 1 Version 2 Version 3 They can update their local repositories with new data and push it to the central server
Distributed Version Control System Distributed VCS Developer A Developer B Developer C Version 1 Version 2 Version 3 Version 1 Version 2 Version 3 Version 1 Version 2 Version 3Version 1 Version 2 Version 3 Git tool is an example of Distributed VCS
Distributed Version Control System Remote Repository Commit Update Push Pull Commit Update Push Pull Push Pull Commit Update Working Copy Local Repository Working Copy Local Repository Working Copy Local Repository
What’s in it for you? What’s in it for you?Version Control SystemWhat is Git?
What is Git? GitHub Remote Server Developer 1 Developer 3 Developer 2 Git is used to track changes in the source code Git is a distributed version control tool used for source code management Allows multiple developers to work together Supports non-linear development because of thousands of parallel branches Has the ability to handle large projects efficiently
What’s in it for you? What’s in it for you?Version Control SystemGit vs GitHub
Git vs GitHub 2 3 4 It is installed on the local system It is used to manage different versions of the source code It provides a command line to interact with the files 1 2 3 4 GitHub is a service It is hosted on the web It is used to have a copy of the local repository code It provides a graphical interface to store the files 1 Git is a software tool
What’s in it for you? What’s in it for you?Version Control SystemGit Architecture
Git Architecture Working Directory Local Working Directory is the folder where you are currently working
Git Architecture Working Directory Staging Area git add Local You add your files to the staging area before making a commit
Git Architecture Working Directory Local RepositoryStaging Area git add git commit Local After making all the changes, you commit those files to the local repository
Git Architecture Working Directory Local RepositoryStaging Area Remote Repository git add git commit git push Local Remote You can push the committed files to the remote repository
Git Architecture Working Directory Local RepositoryStaging Area Remote Repository git add git commit git push git pull Local Remote git pull fetches all the changes from a remote repository to a local repository
Git Architecture Working Directory Local RepositoryStaging Area Remote Repository git add git commit git push git pull git checkout Local Remote You can create new branches and switch to them as and when required
Git Architecture Working Directory Local RepositoryStaging Area Remote Repository git add git commit git push git pull git checkout git merge Local Remote After you are done with the changes, you can merge the new branches to the master branch
What’s in it for you? What’s in it for you?Version Control SystemGit Concepts
Forked Test_Repository Fork and Clone Git Rebase Pull from a remote Now that we have understood Git and it’s architecture, let’s learn some git concepts Git Concepts Adding Collaborators Branch in Git
What’s in it for you? What’s in it for you?Version Control SystemFork and Clone
Fork and Clone Hey, I want to propose some changes to your project Sure. Go ahead and Fork it
Fork and Clone Git allows you to fork an open source repository. When you fork a repository, you create a copy of it on your GitHub account. Someone else’s repository Your own repository Forked Test_Repository Test_Repository Fork
Fork and Clone After you fork a repository, you can clone it and have a copy of it on your local system. Someone else’s repository Your own repository Forked Test_Repository Test_Repository Fork Local Repository Clone to you local computer from GitHub
What’s in it for you? What’s in it for you?Version Control SystemCollaborators
Collaborators Ok, let me add you as a Collaborator on GitHub and give you the permission Hey, there are some errors in your code repository, I need to fix it
Collaborators GitHub allows you to work with users from all over the world at any given time Collaborators are GitHub users who are given permission to edit a repository owned by someone else Anonymous UserRepository’s Owner Your repository  Access all the files  View the files  Make changes to the files  Commit the files
What’s in it for you? What’s in it for you?Version Control SystemBranch in Git
Branch in Git Suppose you are working on an application and you want to add a new feature to the app You can create a new branch and build the new feature on that branch Master branch New branch New Feature Application  By default, you always work on the master branch  The circles on the branch represent various commits made on the branch
Branch in Git  The diagram shows there are 2 new branches  You can develop the features you want separately Branch in Git is used to keep your changes until they are ready Master Branch New Branch New Branch Application
Branch in Git  The diagram shows there are 2 new branches  You can develop the features you want separately Branch in Git is used to keep your changes until they are ready  After you develop them completely, you can merge the newly created branches to the master branch New Branch New Branch Master Branch Application
What’s in it for you? What’s in it for you?Version Control SystemGit Merge
Git Merge a b c d e f g Master Feature Master The base commit of feature branch is b There can be multiple divergent branches
Git Merge a b c d e f g Master Feature Master The base commit of feature branch is b There can be multiple commits for each new branch you create
What’s in it for you? What’s in it for you?Version Control SystemGit Rebase
Git Rebase a b c d e f Master Feature f_e_ Feature Feature d_ Feature The base commit of feature branch is changed from b to c (tip of master) There is no extra commit history
Git Rebase a b c d e f Master Feature f_e_ Feature Feature d_ Feature The base commit of feature branch is changed from b to c (tip of master) Resulting history is linear with no divergent branches
Git Rebase Git Rebase is the process of combining a sequence of commits to a new base commit  The primary reason for rebasing is to maintain a linear project history Master Feature
Git Rebase Git Rebase is the process of combining a sequence of commits to a new base commit  The primary reason for rebasing is to maintain a linear project history  When you rebase, you “unplug” a branch and “replug” it on the tip of another branch (usually master) Master FeatureFeature
Git Rebase Git Rebase is the process of combining a sequence of commits to a new base commit  The primary reason for rebasing is to maintain a linear project history  When you rebase, you “unplug” a branch and “replug” it on the tip of another branch (usually master)  The goal of rebasing is to take all the commits from a feature branch and put it on the master branch Master FeatureFeature
What’s in it for you? What’s in it for you?Version Control SystemPull from Remote
Pull from a Remote Suppose these 2 developers are working together on an application
Pull from a Remote They makes changes to their codes and submit it to the remote repository Remote Repository
Pull from a Remote Both of them want to stay updated with the recent changes to the repository Remote Repository
Pull from a Remote They can pull the changes from the remote repository on to their local system Remote Repository Pull from Remote Repository Pull from Remote Repository
Pull from a Remote Your forked Repository Remote Repository Local Repository Pull Your fork Repository  Use the following command to check if there has been any change $ git pull <RemoteName> <BranchName>  If there is no change, it will notify “Already up- to-date”. If there is an change, it will merge those changes to your local repository You can pull in any changes that have been made from your forked remote repository to the local repository
What’s in it for you? What’s in it for you?Version Control SystemCommands in Git
Popular Git Commands git init Initialize a local Git Repository git add / git add . Add one or more files to staging area git commit –m “commit message” Commit changes to head but not to the remote repository git status Check the status of your current repository and list the files you have changed git log Provides a list of all the commits made on your branch
Popular Git Commands git diff View the changes you have made to the file git push origin <branch name> Push the branch to the remote repository so that others can use it Git config –global user.name “Roger” Tell Git who you are by configuring the author name Git config –global user.email roger.1@gmail.com Tell Git who you are by configuring the author email id git clone Creates a Git repository copy from a remote source
Popular Git Commands git remote add origin <server> Connect your local repository to the remote server and add the server to be able to push to it git branch <branch name> Create a new branch git checkout <branch name> Switch from one branch to another git merge <branch name> Merge a branch into the active branch git rebase Reapply commits on top of another base tip
What’s in it for you? What’s in it for you?Version Control SystemDemo on Git
Demo on Git 1. Create a Repository Create a “hello-world” folder Move to hello-world folder Create a new Git instance for a project
Demo on Git 1. Create a Repository Create a file called readme.txt in the hello-world folder Check the status of the repository to find out if there have been changes
Demo on Git 2. Create a new file, add something to that file and commit those changes to Git Add the file you just created to the files you would like to commit to change Commit those changes to the repository’s history
Demo on Git 2. Create a new file, add something to that file and commit those changes to Git Add another line to readme.txt and save View the difference between the file now and how it was at your last commit
Demo on Git 3. Create a GitHub account, add username to your Git configuration Sign up to GitHub account by visiting github.com Add your GitHub username to your Git Configuration
Demo on Git 4. Connect your local and remote repositories and push changes Github.com Log in Click the + sign in the top right Create a Remote repository
Demo on Git 4. Connect your local and remote repositories and push changes Connect your local to your Remote Push your file to remote
Demo on Git 5. Fork a project from github.com and clone it locally Github.com/jlord/patchwork Click the fork button at the top right Once the fork is complete, you will get a copy on your account. Copy your fork’s HTTP URL on the right sidebar Someone else’s repository Your own repository Forked Test_Repository Test_Repository Fork Fork Patchwork Repository: We’ll be using github.com/jlord/patchwork
Demo on Git 5. Fork a project from github.com and clone it locally Change the directory Clone the repository onto your computer
Demo on Git 5. Fork a project from github.com and clone it locally Now, you have got a copy of the repository on your local computer which is automatically connected to the remote repository Go into the folder for the fork it created If the original repository you forked from has some changes, you’d want to pull those changes as well. So, you need to add another remote connection to the original repository with its URL Someone else’s repository Your own repository Forked Test_Repository Test_Repository Fork Local Repository Clone to you local computer from GitHubTest_Repository
Demo on Git 5. Fork a project from github.com and clone it locally
Demo on Git 6. Create a new branch on your fork for your contribution Name of the branch is: add-Simplilearn Master Branch add-Simplilearn Create a new branch
Demo on Git 6. Create a new branch on your fork for your contribution Checkout your branch and go onto a new branch Push your update to your fork on GitHub
Demo on Git 7. Add a collaborator to your project Visit the repository’s GitHub page Click settings icon on the right side menu Select the collaborators tab Type the username and click add Add “reporobot” as a collaborator to your forked Patchwork repository’s page
Demo on Git 8. Keep your file up to date by pulling in changes from collaborators It will give a message “Already up to date”, if nothing has changed. If there are changes, it will merge those changes into your local version. Check if Reporobot has made any changes to your branch
Demo on Git 9. Create a new branch, make changes and merge it to the master branch Create a new local repository called test Move to the test folder Create a new git instance
Demo on Git 9. Create a new branch, make changes and merge it to the master branch Create 2 text files “test1” and “test2” in the test repository Add the two files to master branch and make a commit
Demo on Git 9. Create a new branch, make changes and merge it to the master branch Create a new branch “test_branch” Create a new text file “test3”
Demo on Git 9. Create a new branch, make changes and merge it to the master branch Add test3 file to the new branch Move from the master branch to test_branch
Demo on Git 9. Create a new branch, make changes and merge it to the master branch Merge test_branch file to master branch The master branch has all the files now
Demo on Git 9. Create a new branch, make changes and merge it to the master branch Move from the master branch to test_branch Modify test3 file and commit the changes
Demo on Git 9. Create a new branch, make changes and merge it to the master branch Check the test3 file in master branch The file has not been modified in the master branch Check the file in test_branch Switch to the master branch
Demo on Git 10. Rebase the newly created files on to master branch Create 2 new text files test4 and test5 Switch to test_branch
Demo on Git 10. Rebase the newly created files on to master branch Add the files to test branch Commit the files for rebasing
Demo on Git 10. Rebase the newly created files on to master branch List the files in test_branch Switch to the master branch
Demo on Git 10. Rebase the newly created files on to master branch List the files in the master branch Switch to test_branch Rebase master branch
Demo on Git 10. Rebase the newly created files on to master branch Rebase master branch Switch to master branch
Demo on Git 10. Rebase the newly created files on to master branch Rebase test_branch List the files in master branch
Key Takeaways
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps Tutorial | Simplilearn

Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps Tutorial | Simplilearn

  • 1.
    What’s in itfor you? What’s in it for you?
  • 2.
    What’s in itfor you? Version Control System What is Git? Git Architecture Git vs GitHub Fork and Clone Collaborators Commands in Git Git Demo Branch, Merge and Rebase Distributed Version Control System
  • 3.
    What’s in itfor you? What’s in it for you?Version Control SystemVersion Control System
  • 4.
    Version Control System(VCS) System A File 2.1File 1.1 Repository Version 2File 1 File 2 System A Now we make some changes to the files in System A File 1 ------> saved as File 1.1 File 2 ------> saved as File 2.1 The new files are stored as Version 2 in the repository VCS allows you to store multiple versions of a system file in the remote repository File 1 File 2 Version 1 All the files in System A are stored as Version 1 in the remote repository
  • 5.
    What’s in itfor you? What’s in it for you?Version Control SystemDistributed Version Control System
  • 6.
    Distributed Version ControlSystem Distributed VCS Developer A Developer B Developer C Version 1 Version 2 Version 3 Version 1 Version 2 Version 3 Version 1 Version 2 Version 3Version 1 Version 2 Version 3 All the developers have the entire copy of code on their local system
  • 7.
    Distributed Version ControlSystem Distributed VCS Developer A Developer B Developer C Version 1 Version 2 Version 3 Version 1 Version 2 Version 3 Version 1 Version 2 Version 3Version 1 Version 2 Version 3 Distributed VCS moves from client-server approach of Central VCS to peer-to-peer approach
  • 8.
    Distributed Version ControlSystem Distributed VCS Developer A Developer B Developer C Version 1 Version 2 Version 3 Version 1 Version 2 Version 3 Version 1 Version 2 Version 3Version 1 Version 2 Version 3 They can update their local repositories with new data and push it to the central server
  • 9.
    Distributed Version ControlSystem Distributed VCS Developer A Developer B Developer C Version 1 Version 2 Version 3 Version 1 Version 2 Version 3 Version 1 Version 2 Version 3Version 1 Version 2 Version 3 Git tool is an example of Distributed VCS
  • 10.
    Distributed Version ControlSystem Remote Repository Commit Update Push Pull Commit Update Push Pull Push Pull Commit Update Working Copy Local Repository Working Copy Local Repository Working Copy Local Repository
  • 11.
    What’s in itfor you? What’s in it for you?Version Control SystemWhat is Git?
  • 12.
    What is Git? GitHubRemote Server Developer 1 Developer 3 Developer 2 Git is used to track changes in the source code Git is a distributed version control tool used for source code management Allows multiple developers to work together Supports non-linear development because of thousands of parallel branches Has the ability to handle large projects efficiently
  • 13.
    What’s in itfor you? What’s in it for you?Version Control SystemGit vs GitHub
  • 14.
    Git vs GitHub 2 3 4 Itis installed on the local system It is used to manage different versions of the source code It provides a command line to interact with the files 1 2 3 4 GitHub is a service It is hosted on the web It is used to have a copy of the local repository code It provides a graphical interface to store the files 1 Git is a software tool
  • 15.
    What’s in itfor you? What’s in it for you?Version Control SystemGit Architecture
  • 16.
    Git Architecture Working Directory Local WorkingDirectory is the folder where you are currently working
  • 17.
    Git Architecture Working DirectoryStaging Area git add Local You add your files to the staging area before making a commit
  • 18.
    Git Architecture Working DirectoryLocal RepositoryStaging Area git add git commit Local After making all the changes, you commit those files to the local repository
  • 19.
    Git Architecture Working DirectoryLocal RepositoryStaging Area Remote Repository git add git commit git push Local Remote You can push the committed files to the remote repository
  • 20.
    Git Architecture Working DirectoryLocal RepositoryStaging Area Remote Repository git add git commit git push git pull Local Remote git pull fetches all the changes from a remote repository to a local repository
  • 21.
    Git Architecture Working DirectoryLocal RepositoryStaging Area Remote Repository git add git commit git push git pull git checkout Local Remote You can create new branches and switch to them as and when required
  • 22.
    Git Architecture Working DirectoryLocal RepositoryStaging Area Remote Repository git add git commit git push git pull git checkout git merge Local Remote After you are done with the changes, you can merge the new branches to the master branch
  • 23.
    What’s in itfor you? What’s in it for you?Version Control SystemGit Concepts
  • 24.
    Forked Test_Repository Fork and Clone GitRebase Pull from a remote Now that we have understood Git and it’s architecture, let’s learn some git concepts Git Concepts Adding Collaborators Branch in Git
  • 25.
    What’s in itfor you? What’s in it for you?Version Control SystemFork and Clone
  • 26.
    Fork and Clone Hey,I want to propose some changes to your project Sure. Go ahead and Fork it
  • 27.
    Fork and Clone Gitallows you to fork an open source repository. When you fork a repository, you create a copy of it on your GitHub account. Someone else’s repository Your own repository Forked Test_Repository Test_Repository Fork
  • 28.
    Fork and Clone Afteryou fork a repository, you can clone it and have a copy of it on your local system. Someone else’s repository Your own repository Forked Test_Repository Test_Repository Fork Local Repository Clone to you local computer from GitHub
  • 29.
    What’s in itfor you? What’s in it for you?Version Control SystemCollaborators
  • 30.
    Collaborators Ok, let meadd you as a Collaborator on GitHub and give you the permission Hey, there are some errors in your code repository, I need to fix it
  • 31.
    Collaborators GitHub allows youto work with users from all over the world at any given time Collaborators are GitHub users who are given permission to edit a repository owned by someone else Anonymous UserRepository’s Owner Your repository  Access all the files  View the files  Make changes to the files  Commit the files
  • 32.
    What’s in itfor you? What’s in it for you?Version Control SystemBranch in Git
  • 33.
    Branch in Git Supposeyou are working on an application and you want to add a new feature to the app You can create a new branch and build the new feature on that branch Master branch New branch New Feature Application  By default, you always work on the master branch  The circles on the branch represent various commits made on the branch
  • 34.
    Branch in Git The diagram shows there are 2 new branches  You can develop the features you want separately Branch in Git is used to keep your changes until they are ready Master Branch New Branch New Branch Application
  • 35.
    Branch in Git The diagram shows there are 2 new branches  You can develop the features you want separately Branch in Git is used to keep your changes until they are ready  After you develop them completely, you can merge the newly created branches to the master branch New Branch New Branch Master Branch Application
  • 36.
    What’s in itfor you? What’s in it for you?Version Control SystemGit Merge
  • 37.
    Git Merge a bc d e f g Master Feature Master The base commit of feature branch is b There can be multiple divergent branches
  • 38.
    Git Merge a bc d e f g Master Feature Master The base commit of feature branch is b There can be multiple commits for each new branch you create
  • 39.
    What’s in itfor you? What’s in it for you?Version Control SystemGit Rebase
  • 40.
    Git Rebase a bc d e f Master Feature f_e_ Feature Feature d_ Feature The base commit of feature branch is changed from b to c (tip of master) There is no extra commit history
  • 41.
    Git Rebase a bc d e f Master Feature f_e_ Feature Feature d_ Feature The base commit of feature branch is changed from b to c (tip of master) Resulting history is linear with no divergent branches
  • 42.
    Git Rebase Git Rebaseis the process of combining a sequence of commits to a new base commit  The primary reason for rebasing is to maintain a linear project history Master Feature
  • 43.
    Git Rebase Git Rebaseis the process of combining a sequence of commits to a new base commit  The primary reason for rebasing is to maintain a linear project history  When you rebase, you “unplug” a branch and “replug” it on the tip of another branch (usually master) Master FeatureFeature
  • 44.
    Git Rebase Git Rebaseis the process of combining a sequence of commits to a new base commit  The primary reason for rebasing is to maintain a linear project history  When you rebase, you “unplug” a branch and “replug” it on the tip of another branch (usually master)  The goal of rebasing is to take all the commits from a feature branch and put it on the master branch Master FeatureFeature
  • 45.
    What’s in itfor you? What’s in it for you?Version Control SystemPull from Remote
  • 46.
    Pull from aRemote Suppose these 2 developers are working together on an application
  • 47.
    Pull from aRemote They makes changes to their codes and submit it to the remote repository Remote Repository
  • 48.
    Pull from aRemote Both of them want to stay updated with the recent changes to the repository Remote Repository
  • 49.
    Pull from aRemote They can pull the changes from the remote repository on to their local system Remote Repository Pull from Remote Repository Pull from Remote Repository
  • 50.
    Pull from aRemote Your forked Repository Remote Repository Local Repository Pull Your fork Repository  Use the following command to check if there has been any change $ git pull <RemoteName> <BranchName>  If there is no change, it will notify “Already up- to-date”. If there is an change, it will merge those changes to your local repository You can pull in any changes that have been made from your forked remote repository to the local repository
  • 51.
    What’s in itfor you? What’s in it for you?Version Control SystemCommands in Git
  • 52.
    Popular Git Commands gitinit Initialize a local Git Repository git add / git add . Add one or more files to staging area git commit –m “commit message” Commit changes to head but not to the remote repository git status Check the status of your current repository and list the files you have changed git log Provides a list of all the commits made on your branch
  • 53.
    Popular Git Commands gitdiff View the changes you have made to the file git push origin <branch name> Push the branch to the remote repository so that others can use it Git config –global user.name “Roger” Tell Git who you are by configuring the author name Git config –global user.email roger.1@gmail.com Tell Git who you are by configuring the author email id git clone Creates a Git repository copy from a remote source
  • 54.
    Popular Git Commands gitremote add origin <server> Connect your local repository to the remote server and add the server to be able to push to it git branch <branch name> Create a new branch git checkout <branch name> Switch from one branch to another git merge <branch name> Merge a branch into the active branch git rebase Reapply commits on top of another base tip
  • 55.
    What’s in itfor you? What’s in it for you?Version Control SystemDemo on Git
  • 56.
    Demo on Git 1.Create a Repository Create a “hello-world” folder Move to hello-world folder Create a new Git instance for a project
  • 57.
    Demo on Git 1.Create a Repository Create a file called readme.txt in the hello-world folder Check the status of the repository to find out if there have been changes
  • 58.
    Demo on Git 2.Create a new file, add something to that file and commit those changes to Git Add the file you just created to the files you would like to commit to change Commit those changes to the repository’s history
  • 59.
    Demo on Git 2.Create a new file, add something to that file and commit those changes to Git Add another line to readme.txt and save View the difference between the file now and how it was at your last commit
  • 60.
    Demo on Git 3.Create a GitHub account, add username to your Git configuration Sign up to GitHub account by visiting github.com Add your GitHub username to your Git Configuration
  • 61.
    Demo on Git 4.Connect your local and remote repositories and push changes Github.com Log in Click the + sign in the top right Create a Remote repository
  • 62.
    Demo on Git 4.Connect your local and remote repositories and push changes Connect your local to your Remote Push your file to remote
  • 63.
    Demo on Git 5.Fork a project from github.com and clone it locally Github.com/jlord/patchwork Click the fork button at the top right Once the fork is complete, you will get a copy on your account. Copy your fork’s HTTP URL on the right sidebar Someone else’s repository Your own repository Forked Test_Repository Test_Repository Fork Fork Patchwork Repository: We’ll be using github.com/jlord/patchwork
  • 64.
    Demo on Git 5.Fork a project from github.com and clone it locally Change the directory Clone the repository onto your computer
  • 65.
    Demo on Git 5.Fork a project from github.com and clone it locally Now, you have got a copy of the repository on your local computer which is automatically connected to the remote repository Go into the folder for the fork it created If the original repository you forked from has some changes, you’d want to pull those changes as well. So, you need to add another remote connection to the original repository with its URL Someone else’s repository Your own repository Forked Test_Repository Test_Repository Fork Local Repository Clone to you local computer from GitHubTest_Repository
  • 66.
    Demo on Git 5.Fork a project from github.com and clone it locally
  • 67.
    Demo on Git 6.Create a new branch on your fork for your contribution Name of the branch is: add-Simplilearn Master Branch add-Simplilearn Create a new branch
  • 68.
    Demo on Git 6.Create a new branch on your fork for your contribution Checkout your branch and go onto a new branch Push your update to your fork on GitHub
  • 69.
    Demo on Git 7.Add a collaborator to your project Visit the repository’s GitHub page Click settings icon on the right side menu Select the collaborators tab Type the username and click add Add “reporobot” as a collaborator to your forked Patchwork repository’s page
  • 70.
    Demo on Git 8.Keep your file up to date by pulling in changes from collaborators It will give a message “Already up to date”, if nothing has changed. If there are changes, it will merge those changes into your local version. Check if Reporobot has made any changes to your branch
  • 71.
    Demo on Git 9.Create a new branch, make changes and merge it to the master branch Create a new local repository called test Move to the test folder Create a new git instance
  • 72.
    Demo on Git 9.Create a new branch, make changes and merge it to the master branch Create 2 text files “test1” and “test2” in the test repository Add the two files to master branch and make a commit
  • 73.
    Demo on Git 9.Create a new branch, make changes and merge it to the master branch Create a new branch “test_branch” Create a new text file “test3”
  • 74.
    Demo on Git 9.Create a new branch, make changes and merge it to the master branch Add test3 file to the new branch Move from the master branch to test_branch
  • 75.
    Demo on Git 9.Create a new branch, make changes and merge it to the master branch Merge test_branch file to master branch The master branch has all the files now
  • 76.
    Demo on Git 9.Create a new branch, make changes and merge it to the master branch Move from the master branch to test_branch Modify test3 file and commit the changes
  • 77.
    Demo on Git 9.Create a new branch, make changes and merge it to the master branch Check the test3 file in master branch The file has not been modified in the master branch Check the file in test_branch Switch to the master branch
  • 78.
    Demo on Git 10.Rebase the newly created files on to master branch Create 2 new text files test4 and test5 Switch to test_branch
  • 79.
    Demo on Git 10.Rebase the newly created files on to master branch Add the files to test branch Commit the files for rebasing
  • 80.
    Demo on Git 10.Rebase the newly created files on to master branch List the files in test_branch Switch to the master branch
  • 81.
    Demo on Git 10.Rebase the newly created files on to master branch List the files in the master branch Switch to test_branch Rebase master branch
  • 82.
    Demo on Git 10.Rebase the newly created files on to master branch Rebase master branch Switch to master branch
  • 83.
    Demo on Git 10.Rebase the newly created files on to master branch Rebase test_branch List the files in master branch
  • 84.

Editor's Notes