Git – Pull from repository to local forcing

From here

Important: If you have any local changes, they will be lost. With or without --hard option, any local commits that haven’t been pushed will be lost.[*]

If you have any files that are not tracked by Git (e.g. uploaded user content), these files will not be affected.


I think this is the right way:

git fetch --all

Then, you have two options:

git reset --hard origin/master

OR If you are on some other branch:

git reset --hard origin/<branch_name>

Explanation:

git fetch downloads the latest from remote without trying to merge or rebase anything.

Then the git reset resets the master branch to what you just fetched. The --hard option changes all the files in your working tree to match the files in origin/master


Maintain current local commits

[*]: It’s worth noting that it is possible to maintain current local commits by creating a branch from master before resetting:

git checkout master
git branch new-branch-to-save-current-commits
git fetch --all
git reset --hard origin/master

After this, all of the old commits will be kept in new-branch-to-save-current-commits.

Uncommitted changes

Uncommitted changes, however (even staged), will be lost. Make sure to stash and commit anything you need. For that you can run the following:

git stash

And then to reapply these uncommitted changes:

git stash pop

Yum how to check for installed packages

run : yum list installed

Further if you read the yum.conf man page:

  1. Red: ‘bold,red’:
    • packages in list/info installed which has no available package with the same name and arch.
  2. Yellow: ‘bold,yellow’:
    • packages in list/info installed which are newer than the latest available package with the same name and arch.
  3. Blue: ‘bold,blue’:
    • packages in list/info available which is an upgrade for the latest installed package with the same name and arch.
  4. Cyan: ‘dim,cyan’:
    • packages in list/info available which is a downgrade for the latest installed package with the same name and arch.
  5. White: ‘bold’:
    • packages in list/info installed which are older than the latest available package with the same name and arch.
  6. White and underlined: ‘bold,underline’:
    • kernel packages in list/info installed which is the same version as the running kernel.

Configure Static IP Address in CentOS 7.6 Virtual Box

  1. Set virtual box like this:
  2. Log into Linux Centos and edit the file:

    vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 and modify the configuration like this in order to have a fix ip in your network and permit you to enter with a ssh console. (you have to modify the ip according to your network configuration.)

    TYPE=Ethernet
    PROXY_METHOD=none
    BROWSER_ONLY=no
    BOOTPROTO=static
    DEFROUTE=yes
    IPV4_FAILURE_FATAL=no
    IPV6INIT=yes
    IPV6_AUTOCONF=yes
    IPV6_DEFROUTE=yes
    IPV6_FAILURE_FATAL=no
    IPV6_ADDR_GEN_MODE=stable-privacy
    NAME=enp0s3
    UUID=6d9a4e86-ae47-456d-97ae-93ce156f9cd9
    DEVICE=enp0s3
    ONBOOT=yes
    IPADDR=192.168.178.131
    NETMASK=255.255.255.0
    GATEWAY=192.168.178.1
    BNS=8.8.8.8
    

     

  3. Modify the file /etc/resolv.conf like :
    nameserver 8.8.8.8
    
  4. restart the network service :service network restart
  5. check the configuration: ifconfig or ping your gateway

How to fix Cannot change version of project facet Dynamic Web Module to 3.0 Error in Eclipse

Cannot change version of project facet Dynamic Web Module to 3.0

Today while converting Dynamic Web Project to Maven project I got below Error:

What steps I’ve performed to fix this?

In order to fix this first thing I did is to change Project Facets settings.

  1. Right click on Project in Eclipse
  2. Click on Properties
  3. Click on Project Facets Tab
  4. Change value from 3.1 to 3.0 for Dynamic Web Module as mentioned in below image.

Eclipse Project facets - Dynamic Web Module

Did it fix my problem? Unfortunately No

I was not able to apply setting as Apply and OK button was grayed out with error msg: Cannot change version of project facet Dynamic Web Module to 3.0.

I was literally stuck at this point, then How did I fix this issue?

Step-1

  • Go to your Eclipse Workspace location
  • If you don’t find location then
    • Right click on project
    • Click on Resource
    • Go to your Location

Find Workspace Resource Properties - Crunchify Workspace

Step-2

Go to location and open file <workspace>/.settings/org.eclipse.wst.common.project.facet.core.xml.

Find Eclipse org.eclipse.wst.common.project.facet.core.xml Path

Step-3

Modify version for jst.web property to 3.0 from 3.1 and save file.

Step-4

  • Refresh project
    • Right click on Project
    • Refresh (F5)
  • Clean project
    • Click on Project
    • Select Clean
  • Again
    • Right-click on project name
    • Click on Maven
    • Update project
  • Now checkout Project Facets screen again and error should be gone for you.

There will not be any error for Dynamic Web Module - Crunchify

 

Unistall Postgres sql

To remove postgres find the root postgres directory normally like

/Library/PostgreSQL/9.6

run : uninstall-postgresql

will remain the data folder and you have to remove manually.

start new installation (change your version/folder number):

sudo /Library/PostgreSQL/10/bin/pg_ctl -D  /Library/PostgreSQL/10/data start

stop postgres:

sudo /Library/PostgreSQL/10/bin/pg_ctl -D  /Library/PostgreSQL/10/data stop