PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, May 15, 2022

[FIXED] how to automate to pass answer to commad line

 May 15, 2022     bash, git, linux, ubuntu, unix     No comments   

Issue

Trying to automate my github authentication whenever I run git push it asks me for username and authentication enter image description here

I want to automate it throw script so that whenever it asks for username my script will pass it NOTE: even git push command is automated through script

Here is how I automates git push using script

read -p "Do you want to push changes? (y/n)" push_choice 
if [ "$push_choice" == "y" ];
then
git push

its more than this but after code hit git push command it asks me for password and username.

So is there any way that this script will pass all the information it needed because everytime it asks for same username and pass


Solution

Use SSH with public key authentication instead of password.

See e.g. https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh



Answered By - Bodo
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing