Local projects will be uploaded to gitlab

  1. Install git on Windows, https://git-scm.com/downloads
  2. New projects
  1. Creating a key
  a, desktop right

b、cd ~/.ssh/

If the prompt "No such file or directory", you can manually create a folder .ssh
mkdir ~/.ssh
c, configure a global name and email, with reference to the following figure:
git config --global user.name "1"
git config --global user.email "[email protected]"
 
If you accidentally mistype how to do?
Then I tried to use
$ Git config --global --replace-all user.email "Enter your email"
$ Git config --global --replace-all user.name "Enter your user name"
 
And then view the next
$ git config --list
Modify found success.
 
 
d, key generation
ssh-keygen -t rsa -C "[email protected]"

e, and finally generate two files: id_rsa ( Private Key: Private key ) and id_rsa.pub ( public Key: Public key

 

f, the id_rsa.pub ( : public Key public key and paste) the contents of the keys to gitlab:

 

 

g, key creation success
4、上传项目:
 
a、右键要上传的项目,选择Git Bash Here
b、参考创建的工程页面:
 
 
输入下面的命令:
 
git config --global user.name "1"
git config --global user.email "[email protected]"
git init
git remote add origin ssh://[email protected]:1/selenium.git
git add .
git commit -m "程序源代码"
git push -u origin master
 
c、项目上传成功
 

Guess you like

Origin www.cnblogs.com/mengmengxidi/p/11330192.html