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-usernamewith your Git username.your-passwordwith your Git password (or personal access token if using GitHub).your-repowith the repository name.
Git will use this credential for the specific push.

最低0.47元/天 解锁文章
1528

被折叠的 条评论
为什么被折叠?



