Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Git can be installed in any operating systems like Windows, Linux and Mac. Most of the Mac and Linux machines, Git will be pre-installed.
GitHub is an open source tool which helps the developers to manage, store, track and control changes in their code. If we want to clone(copy) the data from GItHub we need to install Git.
There are some alternatives for GitHub like GitLab, Bitbucket. But many developers prefer GitHub because it's more popular and they are used to the navigation. So we are using Git in DIGIT
GitHub is used to create Individual projects.
To check whether Git is already installed in your systems, open in terminal.
If you are in Mac, look for the command prompt application called "Terminal".
If you are in Windows, open the windows command prompt or "Git Bash".
Type the below command:
In Ubuntu using terminal we can directly install Git using terminal.
Go to command prompt shell and run the following command to make sure everything is up-to-date.
After that run the following command to install Git.
Once the command output has completed, verify the installation using
Go to the following page to download the Git latest version: For Windows: https://gitforwindows.org/ For Mac: https://sourceforge.net/projects/git-osx-installer/files/git-2.23.0-intel-universal-mavericks.dmg/download?use_mirror=autoselect
Once the installation is done, open the windows command prompt or Git Bash and type
You can store a variety of projects in GitHub repositories, including open source projects. with open source projects you can share your code in repositories with others to track your work.
To create a new repository, click on + icon and New repository
Create your with repo with any name based on your code. Make it as public. Then anyone can able to see your code.
If you want to add a README file, click on add a README file. It is helpful to understand how does the code present in repo will be helpful.
Next click on create repository.
You can create branch protection rule, such as requiring an approving review or passing status checks for all pull requests merged into the protected branch.
Go to the repository and click on new branch.
Here I have created a branch named DIGIT
After, go to that branch in the same repository.
Branch protection rule states that, how to manage the branch restrictions/permissions in GitHub.
NOTE : You must have admin access orelse you have to be a codeowner to make these changes for branch restrictions/permissions.
Open https://github.com and choose any repository.Go to the main page. Click on settings.
Click on branches
If you click on the Edit rules you can able to see the rules which are applied for that branch.you should follow the rules when ever you are going to made any changes to that branch and pushing it.
If you want to create new branch protection rule click on Add Rule.
The common restrictions we are following to merge branches are :
1.Requires pull request
2.Requires approvals from CODE OWNERS
Only the CODE OWNERS can have access to merge and makes changes to these rules.
In eGovernments Foundations we are having multiple number of Teams. we can create independent teams to manage repository permissions and mentions for groups of people.
Only organization owners and maintainers can create team. Owners can also restrict creation permissions for all teams in an organization.
First sign in to your organization github account.
Once you sign in to your account and if you open view organization you can able to see the above page.
Click on Teams. You will see the below image.
Now, click on the New team
Fill the details as shown in the below image:
After creating team, you will able to see the below image.
If you click on members.you can add members to your team by providing their github username or mail.
Now, you have successfully created GitHub team.
Creating a GitHub account and an organization to provide access and permissions to a repository.
An organization are shared accounts where businesses and open source projects can collaborate across many projects at once.There are three types accounts in GitHub
Personal accounts
Organization accounts
Enterprise accounts
Here the main reason for creating organization account is, accounts can be shared among unlimited number of people and they can collaborate across many projects at once.
Our organization name is eGovernments Foundation.
Go to
After completing the process Your GitHub account will be created.
Click on Sign Up. Create your account by using email and password. Then add Username.
After completing the process Your GitHub account will be created.
After setting up the GitHub account, we have to create an organization. Here we can add the data or code in the form of repository. Creating a repository, we will see this topic next.
Open Github and click on the "+" icon add top tight corner. You will see the option"new organization". click it.
click on "create a free organization"and enter your organization name you want to create with email and then '"next"
After Organization got created, you can see your organizations by clicking on "Accounts
A fork is a copy of a repository that you manage. Forks let you make changes to a project without affecting the original repository.
You can fetch updates from or submit changes to the original repository with pull requests
A fork often occurs when a developer becomes dissatisfied or disillusioned with the direction of a project and wants to detach their work from that of the original project.
You can create and register an OAuth App under your personal account or under any organization you have administrative access to. While creating your OAuth app, remember to protect your privacy by only using information you consider public.
Note: A user or organization can own up to 100 OAuth apps.
In the upper-right corner of any page, click your profile photo, then click Settings.
In the left sidebar, click Developer settings.
In the left sidebar, click OAuth Apps.
Click New OAuth App.
Note: If you haven't created an app before, this button will say, Register a new application.
In "Application name", type the name of your app.
Warning: Only use information in your OAuth app that you consider public. Avoid using sensitive data, such as internal URLs, when creating an OAuth App.
In "Homepage URL", type the full URL to your app's website.
Optionally, in "Application description", type a description of your app that users will see.
In "Authorization callback URL", type the callback URL of your app.
Note: OAuth Apps cannot have multiple callback URLs, unlike GitHub Apps.
If your OAuth App will use the device flow to identify and authorize users, click Enable Device Flow. For more information about the device flow, see "Authorizing OAuth Apps."
Click Register application.
In every branch of repository there will be a CODEOWNER file. The people inside the CODEOWNER file are responsible for code in repository.
People with admin or owner permissions can set up a CODEOWNERS file in a repository.
The people you choose as code owners must have write permissions for the repository.
When the code owner is a team, that team must be visible and it must have write permissions, even if all the individual members of the team already have write permissions directly, through organization membership, or through another team membership.
For every branch there will be a CODEOWNER file. Only they can able to write the code and able to merge the pull requests.
Go to any of your branch(DIGIT branch created previously) in a repository and click on new file and name it as CODEOWNERS
Click on "Create a new branch for this commit and start a pull request" and click on propose new file
Next click on Create pull request and then Merge pull request and confirm merge.
Add the GitHub Id's of all the team or people whom you want to add.
With SSH keys, you can connect to GitHub without supplying your username and personal access token at each visit. You can also use an SSH key to sign commits.
Open Your "Command prompt" or "Terminal".
Type below commands to generate SSH key
Now a .ssh folder is created in your home directory. Go to that directory.
copy the SSH key which we get after running the above commands.
open GitHub and add this SSH key as shown below:
open Settings and go to SSH and GPG keys
Click on New SSH key and paste it. Click on Add SSH key.
If you want check the private key, use
You can invite anyone to become a member of your organization (whether they are already member in another organization) using their username or email address for GitHub.com.
In the top right corner of GitHub.com, click your profile photo, then click Your organizations.
Click the name of your organization
After that click on People
Next, Click on Invite member
Type the username, full name, or email address of the person you want to invite and click Invite.
Go to the repository and click on settings
Next click on Collaborators and teams.
Provide access to edit the code based on the user request.