To push to a Git repository using a specific username and password for one time, you can do so using the HTTPS URL with embedded credentials, or by temporarily overriding the credentials in your Git command.
Here’s how you can do it:
Option 1: Use HTTPS URL with Username and Password
You can include your username and password directly in the URL for a one-time push. Be cautious, as this method exposes the credentials in the terminal history.
git push https://your-username:your-password@github.com/your-repo.git
Replace:
your-username
with your Git username.your-password
with your Git password (or personal access token if using GitHub).your-repo
with the repository name.
Git will use this credential for the specific push.