windows upload project to git.oschina


Today I learned to configure git on windows and upload it to the remote server. After 2 hours, I finally got it. I have read a lot of articles before, all of them are copy and copy, most of them are the same, but they still give a lot of inspiration.

I use git.oschina here. First, register yourself on http://git.oschina.net/ After the registration number, you can create your own project. After the directory is built here, it will start to operate on the local machine. The added project is demo.


Install git on windows, version number: 2.11.0

git download address: windows: https://git-for-windows.github.io 

Baidu cloud download address: link: http://pan.baidu.com/s/1eS618Oi password : 1rwx

First go to the official website to download the git package, choose according to the system of your computer, mine is win7 64-bit.





After downloading, click, I default to go down step by step, no screenshots.

After installation, open git bash on both computers. If you are using git for the first time, you need to generate a secret key and set your own secret key in git.oschina.
Step 1: Enter the following command: ssh-keygen -t rsa -C "Your registered email", there will be several steps to confirm next, just press Enter


 



Step 2: Enter the command: ssh -T [email protected] If the welcome interface appears, it means success

Step 3: Go to find the key: Generally, the directory of the key file is a .ssh file in the user directory, click it to find the key, as shown in the following figure:

Open the key in the file copy and go to git.oschina to set it


Step 4: Set the key, find the ssh public key in the personal data, and paste the key copied earlier



Step 5: Upload the project

Switch to the directory of the project, where you can switch the way you can select commands, or you can right-click the mouse. I use the mouse here, find the project, right-click, find "Git Bash here", and switch directly to the project.

First, you need to create a user: the command is as follows:



 

 1: Then start the initialization, the command: git init (ps: After reading a lot of other people's descriptions, you need to add points after init, I can pass it with or without points);

2: pull: Note that the arrow is actually the project name in oschina, it must be consistent or an error will be reported



 3: add:



 4:commit:



 5:master:



  At this point, you can go to your own git.oschina to see your own project

 

 

 

Note: In the process of uploading the project, if the following error occurs, the user has not been created, and the method of creating a user is also mentioned above.

 
Beginners, if there is anything wrong, please ask Haihan.
 

 


 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326121246&siteId=291194637