Easy to use GitHub Desktop

 As the most popular version control system, GitHub can easily manage project versions. Native git requires more cumbersome commands to operate. In fact, we can use the official GitHub desktop software for graphical interface operations, which is very convenient, but the first step is to install git. 
1. Install git 
        git installation, first download the git installation file, the download link is as follows, GitHub desktop software is also linked in this 
link: https://pan.baidu.com/s/1kHcRFGWkXiSnry4w4oer8w Extraction code: w19x After installing git, you can This test is successful: After the installation is complete, find "Git" -> "Git Bash" in the start menu, and a command line window pops up, indicating that the Git installation is successful! 
 
2. Installing GitHub desktop is 
        also the link above. Download GitHub desktop and install it. 
  
3. To use GitHub desktop, 
        first log in to your GitHub account; then, it will be divided into several usage scenarios: 
       1. There are projects built locally, and there is no warehouse on GitHub. 
             In this case, you need to add a local repository on GitHub desktop (hereafter referred to as gd), file - add local repository, then select the project path to upload, and then click add repository. In this way, the local repository is added. At this time You can see that the left side of gd will show, change, how many, and the right side shows the submitted historical version. At this step, it has not been uploaded to GitHub, and an update is required. Enter the name and description of the update in the lower left corner, and click commit to submit. After this step is completed, it means that the changes made by the project have been submitted. Yes, but it has not been synchronized to GitHub. You need to click, repository - push. After completion, the modification will be synchronized to GitHub. (The first time you need to click on the location of the following figure to identify the newly created local warehouse, you need to set up a remote warehouse. Name, and whether the setting is private). Usually we develop and modify a project, there can be many revisions and submissions, but we don’t need to push every time, we only need to end the development, such as after get off work, then push again at this time, and then all the previous commits The records are synchronized to GitHub. 
 

 
         2. Pull the GitHub project 
               from a new machine If you want to pull the project synchronously on a new machine, first install git and gd, then log in to GitHub on the browser, and enter the warehouse to be synchronized, click clone or download below, There are two methods commonly used here. The first is to copy the project address, then paste the address in as shown in the figure below, select a local warehouse address, confirm it, and the synchronization is complete, ok. 
 
 


 
 
        3. Local projects, synchronizing GitHub online data. 
             We often have such scenarios. We modify the project in the company, upload it to GitHub, and come home. If we want to continue to develop and modify the project, then we need to update the latest development in the company. Version, pull it to the home machine. It's actually very simple, just pull it. As shown in Figure 
 
  
4, GitHub needs to pay attention to several places 
       1. If a project has been uploaded to GitHub, and the warehouse on GitHub is deleted, and the email address later changes the name of the project to upload, then directly add the local warehouse in gd, Use a new name and then push up, it won't work. GitHub will automatically recognize the name of the previous project and report an error saying that the repository exists. At this time, you can create a new warehouse with the previous name on the GitHub website, and add the local warehouse to the GD with the previous name. At this time, uploading is ok; then the question is, what do we really want to change? There is a way. First, go to the warehouse to be modified on the GitHub webpage, click setting, and you can see the settings for modifying the warehouse name, and the local gd, only needs to be restarted, and the warehouse name will be changed synchronously. 
 
  
5. During the rollback
        development of the GitHub desktop version  , we often encounter such a problem. Adding a function or module to a project can run normally before, but after adding new code, an error was reported and I found it again. Not where the problem lies. At this time, if we submit the update of the project before the new module development, then we can now return the project to the state of the last submission, as shown in the figure below. Next to the change is history, showing every time For the submitted record, if you want to return to the last version, select the top record, right-click, and revert this commit (ps: in my use, cross-version return will make an error, and I can only return step by step, I don’t know Please correct me if it is my operation problem). 

Guess you like

Origin blog.csdn.net/xulong5000/article/details/114299173