Home > Mobile >  How can I git push on Ubuntu just one-line command
How can I git push on Ubuntu just one-line command

Time:11-09

I want to git push on Ubuntu just write one line command

Such as

echo -e "email\ntoken" | git push origin branchName

git push origin branchName && email && token 

But after command I have to put my email

enter image description here

CodePudding user response:

You need to:

  1. Configure your remote to use the ssh version of the GitHub repo address instead of the http version.
  2. Generate a public/private ssh key pair, and add the public key to your GitHub account manually via your web browser.

CodePudding user response:

You can provide the username once as part of the https git remote address.

First run git remote -vv to get the full, current remote URL.

Then to change your existing remote, you can do a command like:

git remote set-url origin https://[email protected]/yourname/yourrepo.git

where the new part is yourname@ (substitute your github user name) and the rest of the URL should be the same as shown in git remote -vv

  • Related