Showing posts with label Delete. Show all posts
Showing posts with label Delete. Show all posts

March 10, 2022

Git remove a specific commit(s) from history

 Hi all,

This blog post will let you know about the process of removing the git commit from git history.


Sample Git log

> git log 

38384b3 initial commit

f96751b UI changes

2154131 file added

bf9b9c1 Logic corrections

3e75ab7 Bug fix -> (HEAD)


Use case

Remove the commit "file added"


Procedure

  • Rebase in interaction mode one commit above which we want to remove.

> git rebase -i f96751b

  • All the commits up to the specified commit will be listed in an order with the prefix "pick". Along with commit messages, the useful commands are available like below.

pick = use commit

reword = use commit, but edit the commit message

edit = use commit, but stop for amending

squash = use commit, but meld into previous commit

fixup = like "squash", but discard this commit's log message

exec = run command (the rest of the line) using shell

drop = remove commit

  • Delete the unwanted commits from the file
    • Press 'd' twice to delete line (in case of vi editor)
  • Save and quit the editor
    • esc -> :wq (in case of vi editor)
  • If there are any merge conflicts, resolve it and perform rebase continue
    • > git rebase --continue
  • Once all the merges are completed, perform the push operation
    • > git push --force-with-lease origin
Hope this helps you make sure, you have clean git history.

Feel free to send your suggestions and comments to psrdotcom@gmail.com


November 26, 2018

Oracle Drop/Delete User with All tables and files

Hi All,

Today I am going to explain the procedure to delete/drop a user in Oracle database along with tables and mapped files for that user tablespace.

Pre-requisites

Oracle database with the following

  1. User
  2. Tablespace of the user
  3. Datafile of the tablespace

Procedure

Drop the user

Syntax: DROP USER CASCADE;
Example: DROP USER sampleuser CASCADE;

Make the tablespace offline

Syntax: ALTER TABLESPACE OFFLINE;
Example: ALTER TABLESPACE sampletablespace OFFLINE;

Drop the tablespace with mapped datafile[s]

Syntax: DROP TABLESPACE INCLUDING CONTENTS AND DATAFILES
Example: DROP TABLESPACE sampletablespace INCLUDING CONTENTS AND DATAFILES

With the above 3 commands, you can make sure that, user and user related data has been completed removed from database.

Hope, it will help to resolve your issue.

Please send your feedback and comments to psrdotcom@gmail.com

November 20, 2018

Completely uninstall openjdk in RedHat Enterprise Linux (RHEL)

Hi all,

Today, I'll explain how to uninstall completely the openjdk from the RedHat Enterprise Linux (RHEL) machine.

Some of the softwares requires only the Oracle Java and having the openjdk, sometimes causes an issue. So, some users wants to remove the openjdk from the linux machine.

Pre-requisites


  • openjdk installed on the machine
  • Check for java alternatives, when multiple java versions installed
  • #> /usr/sbin/alternatives --config java
  • Result with + is the currently selected java for the machine


Procedure


1. Find out the installed openjdk versions

#> rpm -qa | grep java
#> rpm -qa | grep jdk

Sample Output:

java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64
java-1.8.0-openjdk-headless-1.8.0.191.b12-1.el7_6.x86_64


2. Remove the all openjdk versions

#> yum remove <>

Example:
#> yum remove java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64
#> yum remove java-1.8.0-openjdk-headless-1.8.0.191.b12-1.el7_6.x86_64

Hope, it is useful for you to configure java on your linux machine.

Please send your feedback and comments to psrdotcom@gmail.com

December 30, 2016

Windows file name too long to delete move copy rename due to destination path too long

Hi friends,

Problem

When i am clearing my old windows folder from the OS installed drive, I had an issue of deleting the files and folder because the path name is too long.

The error message is

"Destination Path Too Long.

The file name(s) would be too long for the destination folder. You can shorten file name and try again, or try a location that has a shorter path."

Background

Windows OS will allow the file path to be max 255 characters. If any file or folder path is beyond 255 characters, you will not be able to perform any file actions like delete / move / copy / rename.

Solution


  1. Navigate to the folder in the windows explorer
  2. Type the following command in the address bar and hit enter key
    • subst j:
  3. Open a new windows explorer window
  4. Now you will be able to see new drive with letter J:
  5. You will be able to delete the files/folders with in the drive
  6. To delete the other files, navigate to the parent folder and delete one after one or multiple folders path at a time.


Please send your feedback or suggestions to psrdotcom@gmail.com

April 30, 2013

Manage/Edit your Runtime Environment in Eclipse EE Version

Hi all,

When you want to change your runtime environment in Eclipse EE version, simply follow these steps

  1. Click on “Window” Menu
  2. Select “Preferences” option
  3. It will open “Preferences” window
  4. On the left hand side of the window, you can find different options.
  5. Select “Server” and choose “Runtime Environments”
  6. Now you can find different runtime environments (if exists)
  7. You can add, edit and remove runtime environments

While creating the project you can choose your own customized environment as well.

Happy coding :)

Please send your feedback and queries to psrdotcom@gmail.com

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com