1. Add a user to the new address and create a fileOpen new AddressSSH User name@ IPPassword:xxxxsudo adduser asamuKnock three times.Enterthen enterN, indicate no password, fill in some details below (optional), enteryGo on?su AsamuSwitch users,Cd/homeYou can see that the user folder has been built. 2. Add SSH key to the root user. SSH inside1). Create. ssh/Authorized_keys Cd/home/gitmkdir. SSHchmod. SSHtouch. ssh/Authorized_keys
chmod. Ssh/authorized_keys 2). Enter Authorized_keys CD. SSHvim Authorized_keys Copy the required SSH keyand press ESC to enter : Wq exit, copy it in. 3. Build an empty repository, the GIT repository on the server usually ends with a. Git and then changes the repository owner to gitCd/homemkdir Asamuchown git:git AsamuCD Asamugit init-bare xxx.gitchown-r git:git xxx.git4. Delete the old address, plus the new addressgit remote Remove Origingit remote add Origin [New.git]git push-u Origin master//Do not submit the branch/trunk separately Tips: rm-r xxx //delete files, delete user same applies ls-a //view hidden files problems that you may encounter1. Each timeClone/push ...Requires a password because the userSSH KeyDid not add in 2.CDCan't get in.. SSHMaybe because the user does not have permissions,su RootTry it, orsudo suTry it again.sudoThe problem
IOS Learning-git version migration