Sunday, 31 October 2021

 

Common Git Commands

 

Take clone of a repository
git clone <remote-repository-url>
 
Create a branch
The branch should always be created from dev branch, for that you need to first checkout to dev branch by the following command
  • git checkout dev
  • git pull origin dev
then create the branch
  • git checkout -b <branch-name>
ex: git checkout -b feature/regtech-533
Here feature notifies that this branch is created for a feature. Similarly for creating a branch for a bug the branch name will be like bug/regtech-113
 
To see the current branch
git branch
 
To see all the branches in a repository
git branch -a
 
Pull from a branch
git pull <branch-name>
git pull origin feature/regtech-533
 
To see the status
git status
 
To see the differences made
git diff
 
staging a file or folder
git add <file or folder name>
ex: git add index.ts
 
committing the changes
git commit -m "message"
ex: git commit -m "Changes made for feature regtech-533"
 
To push the code to repository
git push origin <branch-name>
ex: git push origin feature/regtech-533
 
For Creating a pull request
After pushing the code to the repository
go to github.com repository page
Click on the contribute button below the code and press the open pull request button

Thursday, 19 August 2021

How to Update a Project Rails ('rails', '5.2.5') to 'rails', '6.1.4'

 Follow some basic step to update rails version

1. Go to the Gemfile and replace older rails version to new rails version Like 

    gem 'rails', '5.2.5' gem 'rails', '6.1.4'

    
    gem 'pg', '< 1.0.0' gem 'pg'

    ruby '2.7.1'

2.  After that Run bundle install

3. after that run this:- raile app:update 

 => when we run this cmd I have to keep the changes of these all files which are given below :-

  • bin/setup
  • bin/yarn
  • config.ru
  • config/environments/development.rb
  • config/environments/production.rb
  • config/environments/test.rb
  • config/initializers/content_security_policy.rb
  • config/initializers/new_framework_defaults_6_1.rb
  • config/initializers/permissions_policy.rb
  • db/schema.rb     
4. In this file Dockerfile.dev  FROM ruby:2.6.7 FROM ruby:2.7.1

5. In this file Dockerfile.prod

    FROM ruby:2.6.7-alpine as Builder FROM ruby:2.7.1-alpine as Builder

RUN gem install bundler:2.2.16 RUN gem install bundler:2.2.26

FROM ruby:2.6.7-alpine FROM ruby:2.7.1-alpine


go to this Url for reference :- https://github.com/pmdgithub/auth/pull/202/files

  Common Git Commands   Take clone of a repository git clone <remote-repository-url> ex: git clone  https://github.com/agricor/RegTech...