How to Install and configure Git and GitHub on windows

Step 01 : Download Git

https://git-scm.com

Step 02 : GitHub

https://github.com

Step 03 : Create new Repositories

Step 04 : Open Git Bash

Create folder name:- First in ” C local disk”.

Step 05 : Configure

Step 06 : Create files inside FirstGit and commit, upload in account

Like :- test.txt file inside FirstGit

Open txt file and type some text like :- “This is my first work”.

Step 07 : Upload this file to GitHub

Step 08 : Commit and upload

# Note : Refresh Page.

Step 09 : Change in txt file and push

Change in txt file like :-

This is my first work
This is my first work
This is my first work
This is my first work
This is my first work

Save file.

Refresh Page.

Tagged : / / / / / /

Top 10 Website to Host Git Repository Online

In any industry, code has become one of the most business-critical assets. As a result, storing, securing, and collaborating around code has become a significant challenge for enterprises large and small.

Choosing the right source code management solution is no easy task. Even more so when you think about hosting your code behind your own firewall.

This post takes you through this decision – starting with a few common questions.

One of the first questions you’ll need to answer for yourself is: do you have the resources and expertise to professionally manage your code’s on-premises hosting?

1. Is On-Premise Hosting the Right Choice for You?

Any IT department must follow strict security policies. If your organization’s policies require you to keep your code in-house, then of course you will have to deal with hosting your code behind your firewall.

However, self-hosting your code is not a decision you should rush. There is much to keep in mind.

Security:

In an on-premises scenario, your IT department is responsible for setting up a secure environment and installing relevant updates consistently. Keeping a server secure and properly maintained is nothing to be taken lightly.

Availability / Backups:

Today, the code is important to many areas within the company. Therefore its permanent availability is often important. You should make sure that your server has little or no downtime.

Also, note that losing code can be a life-threatening event for many enterprises. You need to provide a completely fail-safe and complete backup strategy in order to make data loss impossible.

Integrations:

Also, think about other systems that need to interact with your code repository. Things like continuous integration servers or issue tracking systems can be other important parts of your software cycle.

Make sure they can be integrated with your code hosting platform – whether it’s behind a firewall or in the cloud.

Budget:

Depending on your needs, the size of your team, and the number of repositories, different solutions come at wildly different prices. This is true for both self-hosted installations and online services. You need to make sure that your own IT department can handle core subjects like security and maintenance flawlessly.

2. Commercial or OpenSource?

As of today, almost all source code hosting options are commercial systems. In fact, the main argument for paying a really high price sometimes is the professional support that it includes. For further updates in case of problems/queries, you can count on the professionals who help you.

If you don’t need these services, you can consider an open-source solution.

3. Complementing Tools

As with most solutions, the actual task of “source code management” is only part of their offering. This makes sense if you consider that today, software development involves a myriad of different tools and workflows – the ones that work best when tightly integrated with one another. Think issue tracking, code reviews, continuous integration systems, etc.

Here is the list of Top 10 Website to Host Git Repository Online:

1. Amazon AWS CodeCommit:

Amazon’s AWS platform includes hosting for Git repositories. It also comes with features that facilitate collaboration, such as code review and access control.

AWS CodeCommit is a secure, highly scalable, managed source control service that hosts private Git repositories. It makes it easy for teams to collaborate on code securely, including encrypted contributions in transit and at rest. CodeCommit eliminates the need for you to manage your own source control system or worry about scaling up its infrastructure. You can use CodeCommit to store anything from code to binaries. It supports the standard functionality of Git, so it works seamlessly with your existing Git-based tools.

Benefits:

  • Fully managed
  • Secure
  • High availability
  • Faster development lifecycle
  • Use your existing tools
  • Collaborate on code

2. Assembla:

Assembla has a long history in the business with its Subversion hosting. It includes a “workspace” platform with issue management, time tracking, and collaboration tools such as Wiki and its own messaging system.

It is a source code management tool that specializes in providing cloud-based version control services for code projects and agile software development. They provide an additional project management tool for those who use their cloud repositories.

Features:

  • Work together with Git merge requests
  • Collaboration
  • Integrated Issue Tracking
  • Security
  • Package Management
  • Project Management
  • Code Analysis

3. Beanstalk:

Being a very lean and reliable service, Beanstalk is a great option for businesses. It provides its own “deployment” infrastructure and integrates well with other tools such as Zendesk, FogBugz, Basecamp, or Lighthouse.

Features:

  • Easy-to-use service for deploying.
  • Scaling web applications
  • Services developed with Java
  • Backup / Recovery
  • Development Environment
  • Testing

4. Bitbucket:

Bitbucket, one of the giants in the industry.

The biggest advantage of Bitbucket Server is certainly that it comes from Atlassian – the company that develops highly popular products like JIRA and Confluence. This is why the integration with these tools (especially JIRA) in BitBucket Server is seamless.

BitBucket Server is an obvious choice if your development toolchain already relies on other Atlassian products like JIRA and Bamboo.

Features:

  • Merge Checks.
  • Code search
  • Git Large File Storage
  • Bitbucket Pipelines
  • IP whitelisting.

5. Codebase:

One of the few platforms to support Git, Subversion, and Mercurial. Additionally, ticketing, project management, and deployment infrastructure tools are included. The codebase is packed with features to help you manage your code and your project with ease.

Features:

  • Repository Hosting
  • Exception Tracking
  • Time Tracking
  • Customizable Permissions
  • Complete Developer API
  • Powerful Searching & Filtering
  • Custom Branding

6. RhodeCode:

Sophisticated code review and approval system including news feed and mention system. With features like LDAP support and IP restrictions, Roadcode seems to be geared for corporate use.

Roadcode allows developers to use not only Git but Mercurial and Subversion for revision control. Feature-wise, the platform offers the most important collaboration features such as code reviews and pull requests – but banks on flexible integration with external tools for both issue tracking and continuous integration.

Features:

  • Advanced code reviews.
  • Side-by-side diffs.
  • Pull requests.
  • Inline source code chat.
  • Full-text code search and source code indexing.
  • Web-based file adding, editing, deletion.

7. SourceForge:

SourceForge is an open-source community resource that is dedicated to helping you succeed as much as possible in open-source projects. We thrive on community collaboration to help make it a premier resource for open-source software development and distribution.

A classic hosting site whose reputation took a turn for the worse in the early 2010s after some shady practices, SourceForge has been under new ownership since 2016 and is determined to restore its good reputation.

Features:

  • Unlimited bandwidth for Open Source projects
  • Integrated Issue Tracking
  • Spambot protection
  • Extensive worldwide mirror network
  • Download statistics over time, by platform, and by region.
  • Analytics is completely free, takes no time to set up.
  • Automatic platform detection

8. Perforce Helix:

Perforce has the longest history in source code management of all the companies in this overview. It is mostly known for having an impressive tradition in enterprise code hosting through its own Perforce version control system. Recently, however, the company expanded its offering with its new Helix4Git platform.

Features:

  • Security and scalability
  • By mirroring work into a Perforce server
  • Specific branches and files can be locked

Especially will large companies appreciate the long-term experience Perforce as source code management provider; Enterprises can ensure that is well understood their needs and requirements.

9. GitHub:

GitHub is an increasingly popular programming resource that is used to share the access code. It is a social networking site for programmers that use a large range of companies and organizations’ project management and collaboration.

Undisputed number one in the open-source world is having projects like Ruby on Rails or jQuery hosted on GitHub. Offerings include great code review and collaboration features.

Features:

  • Drag and Drop Gist Code.
  • Creating a folder via the Web Interface
  • Using Git URL Shortener.
  • Task Checklist.
  • Using Github Command Line Interface.

10. GitLab:

GitLab is a web-based Git repository that offers free open and private repositories, issue-following capabilities, and wikis. This is a full DevOps platform that enables all tasks to professionals from the project planning and source code management, monitoring, and security. It allows teams to collaborate and build better software.

With open-source background, GitLab code provides the perfect platform to develop at a rapid pace for cooperation. The free Community Edition and Enterprise Edition can be installed on your own servers. A hosted offering running on GitLab.com is also available.

Features:

  • Offers git repository management.
  • Code Reviews
  • Issue tracking
  • Activity feeds and wikis

GitLab teams product helps increase reducing lifecycle and productivity, which creates value for customers return.

There’s a good chance that one of these solutions is the perfect choice for your requirements.

Tagged : / / / / / / / / / / / /

Git Commands Tutorials and Example: Git Reset – Git Revert

A committed snapshot can be undone with the git reverse command. Rather than removing the commit from the project history, it determines how to reverse the modifications made by the commit and adds a new commit with the resulting content. This prevents Git from losing history, which is critical for maintaining the integrity of your revision history and collaborating with confidence.

Reverting vs. Resetting:-

git revert

Use of Git Reset, Git Revert, Git Checkout & Squash Commit | by Ameet  Prajapati | MindOrks | Medium

It’s crucial to note that git revert just undoes a single commit; it doesn’t “revert” a project to its prior state by deleting all future commits. This is referred to as a reset rather than a revert in Git.

Compared to resetting, reverting offers two significant advantages. It is a “safe” action for commits that have already been published to a shared repository since it does not affect the project history. Please check the git reset page for further information on why changing shared history is harmful.

Second, although git reset can only go backwards from the current commit, git revert can target a specific commit at any time in the history. If you wanted to undo an old commit with git reset, for example, you’d have to erase all commits that came after the target commit, then remove the target commit and re-commit all subsequent commits. Needless to say, this isn’t a really elegant undo method.

git reset

git reset soft: When to Use Git Reset, Git Revert & Git Checkout - DEV  Community

If git revert is the “safe” approach to reverse changes, git reset may be considered the “dangerous” alternative. There is no way to recover the original copy when you undo with git reset (and the commits are no longer referenced by any ref or the reflog). When using this tool, be cautious because it’s one of the few Git commands that might cause you to lose your work.

What are Uses of:-

git reset:-

  • The selected file will be removed from the staging area, but the working directory will remain unaltered. This removes a file off the stage without overwriting any modifications.
  • The staging area should be reset to reflect the most recent commit, but the working directory should remain untouched. This upstages all files without overwriting any modifications, allowing you to re-create the staged snapshot from the ground up.
  • Back up the current branch tip to and reset the staging area to match, but don’t touch the working directory. Since then, all changes have been saved in the working directory, allowing you to re-commit the project history with cleaner, more atomic snapshots.

git reset –hard:-

  • To match the most current commit, reset the staging area and working directory. The –hard flag tells Git to overwrite all changes in the working directory, in addition to upstaging modifications. To put it another way, this deletes any uncommitted modifications, so make sure you truly want to get rid of your local changes before using it.
  • Reset both the staging area and the working directory to reflect the current branch tip’s position. This removes not just the uncommitted modifications, but also all subsequent commits.

Tagged : / / / / / / / /

Top 5 Git Version Control Software in Cloud

Version control is a way to keep track of changes to code so that if something goes wrong, we can compare across different code versions and go back to any previous versions we want. This is very essential where many developers are constantly working on/changing the source code.

Benefits of Version Control Software:

The main advantages of using version control software include streamlining the development process, managing the code for multiple projects, and keeping a history of all changes within a code.

A version control software saves all the changes in a repository. So, if developers make a mistake, they can undo it. Also, they can compare the new code with the previous version to resolve their grievance. It can reduce human errors and unintended consequences to a great extent. Very suitable for any web development company around the world.

In addition, it facilitates the management of the project’s centralized repository, file storage, documents, and other information related to the project.

Here is the list of Top 4 git version control software in cloud:

1. GitHUb

GitHub helps software teams collaborate and maintain a full history of code changes. You can track changes in the code, turn back the clock to undo errors, and share your efforts with other team members.

It is a repository for host Git projects. For those wondering what is Git? It is an open-source version control system with local branching, multiple workflows, and convenient staging areas. Git version control is an easy-to-learn alternative and provides faster operation speeds.

Features:

  • Drag and Drop Gist Code.
  • Creating a folder via the Web Interface.
  • Using Github Command Line Interface.
  • Linking Lines.

2. GitLab

GitLab comes with a number of useful features such as an integrated project, a project website, etc. By using GitLab’s continuous integration (CI) capabilities, you can test and distribute code automatically.

You can access all aspects of a project, view the code, receive requests and add conflict resolution.

This version control software is designed for the DevOps lifecycle. Meaning, your projects are quite complex and involve cloud engineering and the like. Gitlab provides basic features such as view code, pull requests, and merge resolution.

  • Development.
  • Security.
  • Ops teams collaborate
  • Build software
  • Reduce development costs

4. Beanstalk

Beanstalk is a perfect choice for those who need to work from remote locations. This software is based on browser and cloud, which allows users to code, commit, review and deploy using the browser.

It allows users to code, commit, review, and deploy code using the browser. For its ease of use, you can integrate it with any messaging or email platform for efficient collaboration.

It can be integrated with messaging and email platforms for efficient collaboration regarding code and updates. It supports both Git and SVN and also comes with built-in analytics features. For security, it takes advantage of encryption, two-factor authentication, and password protection functions.

Features:

  • Variety of Application Deployment Options.
  • Wide Selection of Application Platforms.
  • Management and Updates.
  • Customization
  • Scaling
  • Compliance

4. HelixCore

Helix is one of the best version control systems. It provides an integrated platform for collaborative development and protection of intellectual property of any kind. It benefits from several new capabilities, support for both distributed and centralized development workflows. Helix also provides a complete Git ecosystem. And it comes in both on-premises and cloud versions.

Helixcore provides seamless team collaboration and support for both centralized and distributed development workflows. It is available for both cloud and on-premises deployments, which makes it scalable.

Features:

  • Work order management
  • Applications Management
  • Document Management
  • Access Controls
  • Procurement Management

5. Apache Subversion

Apache Subversion is another open-source version control system, founded a few decades ago by CollabNet. Both open-source arenas and enterprises consider it a reliable option for valuable data.

SVN is easy to implement with any programming language. Also, it provides persistent storage for handling text and binary files.

Features:

  • Inventory management
  • Security management
  • History tracking
  • User access controls
  • Data recovery
  • Workflow management

These are the best version control systems that a web development company should definitely consider using, according to the requirements.

Tagged : / / / / / /

List of Top 5 Git repository management systems in 2021

  1. GitHub.
  2. Bitbucket.
  3. Assembla.
  4. RhodeCode.
  5. DevZing Subversion.

GitHub:-

Github is a collaborative coding tool with version control, branching, and merging all included.

GitHub is the best place to share code with friends, co-workers, classmates, and strangers.

Bitbucket:-

Bitbucket is a cloud-based Git and Mercurial-based source code management and collaboration tool.

Bitbucket is a cloud-based hosting service for projects that use either the Mercurial or Git revision control systems.

Assembla:-

Enterprise cloud version control for secure source code management in the cloud.

Assembla is the world’s only Enterprise Cloud Version Control (ECVC) provider, bringing multi-repository secure source code management to the cloud.

RhodeCode:-

RhodeCode is a fast and powerful management tool for Mercurial and GITand SVN with a built-in push/pull server, full-text search, pull requests, and code-review system.

RhodeCode is a fast and powerful management tool for Mercurial and GIT and Subversion with a built-in push/pull server, full-text search, pull requests, and powerful code-review system. It works on http/https and has a range of unique features.

DevZing Subversion:-

High-speed, secure, available subversion hosting.

Your code is safe and secure and accessible from anywhere.

All plans support SSL (https) for connecting to your repositories.

Free import from other Subversion systems. Friction-free migration.

Send an email on every commit. Always know who is updating your repositories.

What is git?

Git is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows.

Why do we need git?

Git is the most commonly used version control system. Git tracks the changes you make to files, so you have a record of what has been done, and you can revert to specific versions should you ever need to. Git also makes collaboration easier, allowing changes by multiple people to all to be merged into one source.

What is the role of Git repository managment systems?

  • Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
  • It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.
  • A Git repository is the . git/ folder inside a project.
  • This repository tracks all changes made to files in your project, building a history over time.
Tagged : / / / / /

Enforce the JIRA issue id in a GIT commit message

Enforce the JIRA issue id in a GIT commit message

This can be done by using git hooks file location at .git/hooks/commit-msg. Following are the 2 way in whcih each Developers can set the Hooks in their developement envioronment.

Method – 1

# commit-msg.sh
#!/bin/sh
# This hook will make sure that the commit message contains a JIRA issue.
#
# To enable this hook, rename this file to ".git/hooks/commit-msg".
# Make sure to add execution permissions to the file.

export MESSAGE=$(<$1)
export JIRA_ISSUE_TAG='ISSUETAG-([0-9]*)'

if [[ $MESSAGE =~ $JIRA_ISSUE_TAG ]]; then
echo -e "\e[32mGreat, your commit message contains a JIRA issue!\e[0m"
exit 0;
fi

echo -e "\e[31mOh hamburgers ... You forgot to add a JIRA issue number!\e[0m";
exit 1;

Method 2 – This is another very good example to implement to force jira id in each commit message. http://nsbogan.com/tools/2015/06/04/jira-id-in-git-commit-messages

Tagged : / / / /

Best Branching and Merging strategies in git

Best Branching and Merging strategies in git

Step 1 – First you need to learn the needs of branches. This is very good read.

  • https://docs.microsoft.com/en-us/vsts/repos/tfvc/branching-strategies-with-tfvc?view=vsts

Step 2 – Now time has come to Learn best branching model in Git.

  • https://buddy.works/blog/5-types-of-git-workflows
  • https://hackernoon.com/a-branching-and-releasing-strategy-that-fits-github-flow-be1b6c48eca2
  • https://nvie.com/posts/a-successful-git-branching-model/

Step 3 – Now, Lets understand, what is the kind of merges we have in Git?

  • https://www.atlassian.com/git/tutorials/using-branches/git-merge
  • https://git-scm.com/docs/merge-strategies
  • https://stackoverflow.com/questions/366860/when-would-you-use-the-different-git-merge-strategies

Step 4 – Are you still having a questions, Please post in the comment section.

Tagged : / / / / / / /

How to update or pull current branch before committing in Git?

Best practice says that before you commit in git, you need to either do git pull or git fetch/merge. However, there is a way to find out wheather your branches is not in sync with remote.

To check the remote repo status you are really simulating a “fetch”
$ git fetch -v –dry-run

To bring your remote refs up to date
$ git remote -v update

This command will print whether the branch you are tracking is ahead, behind or has diverged with remote. If it says nothing, the local and remote are the same.
$ git status -uno

To pull
$ git pull origin <<branchname>>
or
$ git fetch origin <<branchname>>
$ git merge remote/<<branchname>>
$ git commit

Compare the two branches:
$ git log HEAD..origin/master –oneline

Tagged : / / / / / /

Top 5 Git hosting solutions | List of best Git hosting tools

top-5-git-hosting-solutions
This is the era of DevOps where automation and collaboration is the key of success in software industry. This is the reason code availability is for everyone in the team is the necessity for today’s work environment. Developers are using Git nowadays for their code management and collaboration. But, this is not enough. Now you need to decide, which GIT hosting solution is good for your collaboration within your team or organization.
You can find so many options who offers hosting for GIT Repositories, which makes it really a challenge to find the right solution for your needs. Therefore, we are presenting you the list of top ten git hosting solutions.
Here is the list of Top Five Git Hosting Solutions
1. Bitbucket
 

 Bitbucket
Bitbucket formerly knows as stash belongs to one of the best software solution provider Atlassian who also developed popular tools like JIRA, Bamboo & Confluence. It offers both plans free & Commercial. Bitbucket is written in python.

Key Features
  • web-based hosting service
  • Unlimited private repositories
  • Supports private & Public repositories
  • Native integration (Jira, Confluence,Bamboo)
  • Flexible deployment models
  • Source tree – works with any git hosting
  • Branch permissions
  • Git Large File Storage (LFS)
2. GitHub

 GitHub

Github is one of the top Git hosting solution which is belongs to GitHub, Inc. and founded in the year 2008. As per the latest Github reports they have  52 million repositories which shows that they are one of the most trusted brands in the industry. Github is written also written in Ruby.
Key features
  • web-based hosting service
  • Unlimited private repositories
  • Built-in code review
  • Supports private and Public repositories
  • Support Many Programming language
  • Flexible hosting plans
  • Free to use for public and open source projects
  • Comes with Issue tracking & Wikis
3. GitLab

 GitLab

Gitlab is an open source git hosting service provider which belongs to GitLab Inc. Gitlab claimed themselves as modern software development. This tool is launched in 2011 is written in Ruby and Go. Gitlab is also amongst the most trusted brand which is also used by even NASA. GItlab has more than 1400 contributors which makes it one of the most reliable service provider.
Key Features
  • Unlimited public and private repos
  • web-based Git repository manager
  • wiki and issue tracking features
  • open source
  • Allow Project importing
  • Own Continuous Integration service
  • Collect and share reusable code
  • Control read/write permissions to specific branches
4. Microsoft Visual Studio Team Services

 Microsoft Visual Studio Team Services

Visual studio team services formerly known as Visual Studio Online is a Microsoft product which is launched in the year 2012. Visual studio is also a very good option for Git hosting. This platform includes not only code hosting but it has its own CI & agile planning tools for scrum and kanban teams. If you have 5 members team than you can use there most features for free but you need to upgrade your plans if you want to increase that number.

Key Features
  • Unlimited private code repositories
  • Customizable Dashboards
  • Branch Updates
  • Code reviews
  • Web Hooks & API Integration
  • unlimited free private git repositories
  • Get functionality with extensions
  • Semantic Code Search
  • Security – SOC compliance and multi-factor authentication
  • Built-in continuous integration and support for Jenkins and others tools
5. Perforce

 Perforce

Perforce or perforce helix is also amongst one the most reliable and trusted git hosting solution. Perforce was initially released in the year 1995 which makes it one the veteran player of the software industry. Recently they have introduced Git Swarm with Gitlab collaboration. It comes with similar features like Gitlab but in terms of security and scalability it is more reliable.

Key Features

  • All the power and flexibility of Git without compromise:
  • Access control is more fine-grained
  • Specific branches and files can be locked
  • Developers can “slice” big repositories and pull only what they need
  • Pull requests
  • Merge-request workflow
  • Issue tracking
  • Git powered Wiki
  • Project visibility & security
  • Automatically mirrors work into Helix mainline repository
SO, these are the top players currently trending in GIT hosting solutions. Hope this will help you while selecting your hosting solutions. One more thing, if you think that this list is missing any other solutions instead of this than feel free to share with us in the comment section below.
Tagged : / / / / / / / / / / / / / / / /