Menu

How to delete commits from a branch in Git?

Checkout the branch. e.g we are working here with development branch
$ git checkout development

Go to the commits list and copy the commit id till where you want to remove the commits from branch. then run git reset --hard to delete the all commits above or after that commit id. e.g. commit id is "c9709eb155e18e2eb12e38bf
$ git reset --hard c9709eb155e18e2eb12e38bf

You will got a success message saying "HEAD is now at <commitid> <commit message>". It means your reset is successful.

Now run the git push to push the commit till this commit id to your branch.
$ git push origin development --force


Related Articles:

How to cherry pick in Git 

Error during replication of ReplicationAction | AEM to Demandware

Error during content replication from Adobe experience manager(AEM) to Demandware. If you are seeing this error logged in AEM error.log file or demandware replication agent log, then it means credential configured in configuration Demandware TransportHandler Plugin for WebDAV to transport the data and content from AEM to Demandware is not valid.

*ERROR* [sling-threadpool-a430ddf1-339b-4140-b796-18d2fc7b5a66-(apache-sling-job-thread-pool)-7-com_day_cq_replication_job_demandware(com/day/cq/replication/job/demandware)] com.day.cq.replication.Agent.demandware Error during replication of ReplicationAction{type=ACTIVATE, path[0]='/content/dam/website/content/january/sample_image_winter.jpg', time=1578013615072, userId='rashidjorvee@jorvee.com', revision='null'}: com.day.cq.replication.ReplicationException: com.github.sardine.impl.SardineException: Unexpected response (401 )
03.01.2020 01:07:56.111 *INFO* [sling-threadpool-a430ddf1-339b-4140-b796-18d2fc7b5a66-(apache-sling-job-thread-pool)-7-com_day_cq_replication_job_demandware(com/day/cq/replication/job/demandware)] com.day.cq.replication.Agent.demandware.queue Job for agent demandware processed in 281ms. Failed.

com.day.cq.replication.ReplicationException: com.github.sardine.impl.SardineException: Unexpected response (401 )

Solution:

This error you seeing because of bad WebDev credential. Check the configured WebDev login credential under AEM config manager (http://localhost:4502/system/console/configMgr)   in configuration Demandware TransportHandler Plugin for WebDAV

Demandware TransportHandler Plugin for WebDAV
Demandware TransportHandler Plugin for WebDAV


If you think your credential in valid then please try login directly on the Demanware instance URL with configured credential to verify the credential is valid and working.

Reference:

Enable less secure app access to your google account

If you are trying to configure SMTP mailing service using gmail.smtp and you are getting following errors "Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1
--OR--
ERROR 20952 --- [         task-1] .a.i.SimpleAsyncUncaughtExceptionHandler : Unexpected exception occurred invoking async method: public void jorvee.service.EmailService.sendEmail(org.springframework.mail.SimpleMailMessage)
org.springframework.mail.MailAuthenticationException: Authentication failed; nested exception is javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8  https://support.google.com/mail/?p=BadCredentials 200sm76430073pfz.121 - gsmtp
--OR--

ERROR 18335 --- [ task-2] .a.i.SimpleAsyncUncaughtExceptionHandler : Unexpected exception occurred invoking async method: public void jobtrees.service.EmailService.sendEmail(org.springframework.mail.SimpleMailMessage)
org.springframework.mail.MailAuthenticationException: Authentication failed; nested exception is javax.mail.AuthenticationFailedException: 534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbt
534-5.7.14 Learn more at
534-5.7.14 iC05HX07ZqNpOxwZG97A23wm3QihO6_1fPH781vcxEhWSCrdIXgikYN2holt0u2YZ2l2x 534-5.7.14 cX53zAOHNGSHJJAD7TrXgKGpWv_tg8wup1K7B79BdL0ZrQNJLj7SjTi-qZiwLQur> 534-5.7.14 Please log in via your web browser and then try again.
534 5.7.14 https://support.google.com/mail/answer/78754 m20sm22192035qkk.15 - gsmtp

although, your configuration are valid and correct, then, because of following reason you are facing this issue.

Your account is secured, and doesn't allow less secure applications to access.

By default Less secure app access is disabled in the google account. If you will enable this then it will fix your problem.
To enable the less secure app access in your google account, follow the below steps.
Step 1: Login to your google account.

Step 3: Under the section Less secure apps & your Google Account, expand option If "Less secure app access" is off for your account  or directly go to https://myaccount.google.com/lesssecureapps?pli=1

Step 4: Click on the turn it back on, this will redirect you to a new page.
Less secure apps & your Google Account
Less secure apps & your Google Account 

Step 5: See Allow less secure apps: status and; if this is OFF then ON it.
Allow less secure apps: ON
Allow less secure apps: ON
Step 6: Now go to Account access enabled page https://accounts.google.com/b/0/DisplayUnlockCaptcha  and enable this access.

References: