In your work, you will sometimes encounter that the url of your git submission code has been moved to another URL, so the URL of your local project will also be moved to another url

Start by looking at the location of your project git code

  • git remote— Lists existing remote branches without parameters
  • git remote -v | --verbose—- lists the details, with each name followed by its remote URL
origin  git://github.com/schacon/ticgit.git (fetch)
origin  git://github.com/schacon/ticgit.git (push)
Copy the code
  • git remote set-url origin git://github.com/schacon/ticgit222.gitChange the —– project git url to a new onepushThe code
  • git remote -v
Origin git://github.com/schacon/ticgit222.git (fetch) origin git://github.com/schacon/ticgit222.git (push) has already become the new url, This will allow for normal pull and push codeCopy the code

At work, SSH keys are sometimes added, and then HTTP submissions are turned off, so people who haven’t tied SSH can’t push code

Link: Technical source CSDN’s Fishing song to the Late Big guy

Create an SSH Key to connect to Github or GitLab

  • First you need to have an account on Github or GitLab
  • Open git bash and type the commandls -al ~/.ssh. Check whether there areid_rsa.puborid_dsa.pubThere are
$ls-al ~/. SSH Total 241 drwxr-xr-x 1 Dragon 1049089 drwxr-xr-x 1 Dragon 1049089 rw-r--r-- 1 Dragon 1049089...... ... ... ...Copy the code
  • Or you could just go to your computer and check it outUser > dragon >. SSH.sshdirectory
$ls known_hosts... ... ...Copy the code
  • Type in Git bashSsh-keygen -t rsa -c "Your own email address is good @example.com"Replace the email address here with your own. Just keep pressing Enter after that. You can see it hereid_rsaandid_rsa.pubThe file has been generated. The generated path is also displayed.
  • Open it with softwareid_rsa.pubFile, and copy the entire contents togitlaborgithubOpen the accountSSH keyTAB, and then clickadd key. The public key information is recorded here.
  • Once that’s done, you can proceed with git as long as you have permission on the project you want to operate.
  • If you’re new to the computer, nothing has to be done first:
    1. git config --global user.name karsuo.he.
    1. git config --global user.email [email protected]
    1. ssh-keygen -t rsa -C [email protected]

conclusion

React QQ group:788023830 —- React/Redux - Old underground hero

Front-end COMMUNICATION QQ group:249620372 —- FRONT - END - JS FRONT END

(Our mission is, for overtime, for baldness… , look up to the big guy), I hope friends to study together