Git remote reset

User
reset remote
Assistant
Sure!
"Reset remote" can mean a few different things depending on what you want:

**If you mean in Git (most common use):**

| Situation | Command |
|:—|:—|
| Reset your local branch to match the remote exactly (discard local changes) | `git fetch origin“git reset –hard origin/branch-name` |
| Force push your local branch to overwrite the remote | `git push –force origin branch-name` |
| Remove a remote (like origin) | `git remote remove origin` |
| Change the remote URL | `git remote set-url origin new-url.git` |

**Example:**
If you're on `main` and want to reset it to the remote `origin/main`:

git fetch origin
git reset --hard origin/main

**โšก Warning:** `–hard` will **discard any local uncommitted changes**.

Did you mean **reset remote branch**, **reset remote URL**, or something else?
Tell me a little more so I give you the exact command you need! ๐Ÿš€
Which one are you trying to do?

User
SymfonyComponentMailerExceptionTransportException: Failed to authenticate on SMTP server with username "neeraj.tiw1988@gmail.com" using the following authenticators: "LOGIN", "PLAIN", "XOAUTH2". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535-5.7.8 Username and Password not accepted. For more information, go to
535 5.7.8 https://support.google.com/mail/?p=BadCredentials d2e1a72fcca58-73e25a6a995sm6295912b3a.112 – gsmtp".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535-5.7.8 Username and Password not accepted. For more information, go to
535 5.7.8 https://support.google.com/mail/?p=BadCredentials d2e1a72fcca58-73e25a6a995sm6295912b3a.112 – gsmtp".". Authenticator "XOAUTH2" returned "Expected response code "235" but got code "334", with message "334 eyJzdGF0dXMiOiI0MDAiLCJzY2hlbWVzIjoiQmVhcmVyIiwic2NvcGUiOiJodHRwczovL21haWwuZ29vZ2xlLmNvbS8ifQ==".". in /var/www/html/vendor/symfony/mailer/Transport/Smtp/EsmtpTransport.php:242
Stack trace:
#0 /var/www/html/vendor/symfony/mailer/Transport/Smtp/EsmtpTransport.php(177): SymfonyComponentMailerTransportSmtpEsmtpTransport->handleAuth()
#1 /var/www/html/vendor/symfony/mailer/Transport/Smtp/EsmtpTransport.php(134): SymfonyComponentMailerTransportSmtpEsmtpTransport->doEhloCommand()
#2 /var/www/html/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(249): SymfonyComponentMailerTransportSmtpEsmtpTransport->executeCommand()
#3 /var/www/html/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(272): SymfonyComponentMailerTransportSmtpSmtpTransport->doHeloCommand()
#4 /var/www/html/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(209): SymfonyComponentMailerTransportSmtpSmtpTransport->start()
#5 /var/www/html/vendor/symfony/mailer/Transport/AbstractTransport.php(69): SymfonyComponentMailerTransportSmtpSmtpTransport->doSend()
#6 /var/www/html/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(137): SymfonyComponentMailerTransportAbstractTransport->send()
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(585): SymfonyComponentMailerTransportSmtpSmtpTransport->send()
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(332): IlluminateMailMailer->sendSymfonyMessage()
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(205): IlluminateMailMailer->send()
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php(19): IlluminateMailMailable->IlluminateMail{closure}()
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(198): IlluminateMailMailable->withLocale()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php(83): IlluminateMailMailable->send()
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): IlluminateMailSendQueuedMailable->handle()
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): IlluminateContainerBoundMethod::IlluminateContainer{closure}()
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(95): IlluminateContainerUtil::unwrapIfClosure()
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): IlluminateContainerBoundMethod::callBoundMethod()
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(690): IlluminateContainerBoundMethod::call()
#18 /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): IlluminateContainerContainer->call()
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): IlluminateBusDispatcher->IlluminateBus{closure}()
#20 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): IlluminatePipelinePipeline->IlluminatePipeline{closure}()
#21 /var/www/html/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): IlluminatePipelinePipeline->then()
#22 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(124): IlluminateBusDispatcher->dispatchNow()
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): IlluminateQueueCallQueuedHandler->IlluminateQueue{closure}()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): IlluminatePipelinePipeline->IlluminatePipeline{closure}()
#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(123): IlluminatePipelinePipeline->then()
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(71): IlluminateQueueCallQueuedHandler->dispatchThroughMiddleware()
#27 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(102): IlluminateQueueCallQueuedHandler->call()
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(440): IlluminateQueueJobsJob->fire()
#29 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(390): IlluminateQueueWorker->process()
#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(177): IlluminateQueueWorker->runJob()
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(139): IlluminateQueueWorker->daemon()
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(122): IlluminateQueueConsoleWorkCommand->runWorker()
#33 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): IlluminateQueueConsoleWorkCommand->handle()
#34 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): IlluminateContainerBoundMethod::IlluminateContainer{closure}()
#35 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(95): IlluminateContainerUtil::unwrapIfClosure()
#36 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): IlluminateContainerBoundMethod::callBoundMethod()
#37 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(690): IlluminateContainerBoundMethod::call()
#38 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(213): IlluminateContainerContainer->call()
#39 /var/www/html/vendor/symfony/console/Command/Command.php(279): IlluminateConsoleCommand->execute()
#40 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(182): SymfonyComponentConsoleCommandCommand->run()
#41 /var/www/html/vendor/symfony/console/Application.php(1047): IlluminateConsoleCommand->run()
#42 /var/www/html/vendor/symfony/console/Application.php(316): SymfonyComponentConsoleApplication->doRunCommand()
#43 /var/www/html/vendor/symfony/console/Application.php(167): SymfonyComponentConsoleApplication->doRun()
#44 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(197): SymfonyComponentConsoleApplication->run()
#45 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1203): IlluminateFoundationConsoleKernel->handle()
#46 /var/www/html/artisan(13): IlluminateFoundationApplication->handleCommand()
#47 {main}
Assistant
Alright, the error you are getting:

Failed to authenticate on SMTP server with username "neeraj.tiw1988@gmail.com"
535-5.7.8 Username and Password not accepted

**It simply means:**
๐Ÿ‘‰ Google **blocked** your login because **normal username/password** is **not enough** anymore for Gmail SMTP.

Google **does not allow** "less secure app" login anymore.
Instead you have two options:

# โœ… Solution 1: Use an "App Password" (Recommended)

If you are using Gmail, you **cannot use your real password** for SMTP anymore.
You need to create a special **App Password**.

Steps:
1. Go to: [https://myaccount.google.com/security](https://myaccount.google.com/security)
2. Under **"Signing in to Google"**, enable **2-Step Verification** (if not already).
3. After 2-Step Verification is enabled, go to **App Passwords** section.
4. Choose:
– App: **Mail**
– Device: **Other** โ†’ Type `Laravel SMTP` or anything.
5. Google will generate a **16-character password** for you (something like `abcd efgh ijkl mnop`).
6. **Use this generated password** in your Laravel `.env` file instead of your real password.

**Example in your `.env`:**

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=neeraj.tiw1988@gmail.com
MAIL_PASSWORD=your_app_password_here
MAIL_ENCRYPTION=tls

โœ… Then it will work.

# โœ… Solution 2: Use a different mail service (like SendGrid, Mailgun, etc.)

If you don't want this App Password setup, you can also switch to a service like:
– **Mailgun** (free for small projects)
– **SendGrid** (easy to setup)
– **Postmark** (good for production)

They give you easy SMTP credentials and are meant for websites, not personal emails.

# ๐Ÿ›‘ Why did this happen?
Google **disabled "Less Secure Apps"** login after 2022.
Now, only "App Password" method is allowed for SMTP connections.

**In short:**
๐Ÿ‘‰ Create **App Password** โ†’ use it in your `.env` โ†’ Done โœ…

Would you like me to also show you **how to test** it from your Laravel project after setting it?
(Laravel has a quick command to test email sending ๐Ÿš€)
Would you like me to send that too? ๐ŸŽฏ

Leave a Comment

Your email address will not be published. Required fields are marked *