There, you should see newly added files along with updated changes in the text file. You may press the “Merge” button or “Visualize” the changes before performing a merge.Īs the “Merge” button is pressed, yet a new window appears and displays the progress with the merge complete operation success message.Ĭlose the window and go to the local repository folder again. For that, go to the “Merge” –> “Local Merge” option in top menu or press “Ctrl + M”.Ī new window should appear with a few options as shown below: The final step for completing the pull operation is performing the merge. Also, demo1.txt should not show the recent changes made. If you look at the look repo folder, it should not display the new image that I added in the remote repository. Until now, only fetch operation is completed. Click this and it should show “Fetch From” –> Origin.Īs you press this option, a new window should appear and display the progress for changes from the origin.Īfter green bar appears with the success message, press “Close”. Go to the Git GUI and look for the “Remote” on the top menu. Step 3 – Performing the fetch operation form Git GUI The graphic below shows these two changes: For the example, I have added another image file and also update the “demo1.txt” file content so our Git GUI pull operation downloads and merge two changes. Step 2 – Done with changes in the remote repo?īefore using the GUI, make sure all changes are done in the remote repository. It has menu options for “fetch” and “merge” that you may execute separately.įollow the instructions below for performing a git pull remote operation via GUI.įirst of all, open the GUI from the local repository as shown in the graphic below:įor that, right click after opening the folder content and select the “Git GUI Here” option on the Windows system. However, the GUI for Git does not provide a direct option for executing the pull command (like many other commands). If you are a fan of GUI rather than using command line then you may also use Git GUI for performing pull remote operation. $ git pull –no-commit Performing pull operation via Git GUI However, it will not create a new merge commit: The following pull command downloads / fetches the content of the remote repository. Similarly, the local folder on Windows system should show the newly added images as well as the updated text file. If you run this command again on Git Bash: So, this is how our online repo on Github looks: For explaining, I also changed the content of demo1.txt file. How about making changes in an existing repo/branch in the remote server and then using the pull command.įor example, we added two more image files after performing above operation. In the above section, we learned how to create an online repo and pulling its master branch in the local repo by the pull command of Git. How about using Pull command for existing repositories? This is followed by execution of git merge by pull command. The reason is pull command is the combination of fetch and commit commands.Īs we ran $ git pull in above section, the pull command executed git fetch and downloaded the content from the remote branch. This is what our demo folder “pull-tst” on Windows system contains after running pull command:īack to our question, why we used “fetch” and “commit” terms while talking about pull command. Similarly, you may go to the local active folder where you started Git Bash and see the local repo. You can see, it is showing all four files as in our remote repository in above graphic. One is for the git pull command and the other displays the files in the master branch by using $ ls command. In the graphic, you can see two commands’ output. The Git Bash should display messages like this: This command should download all files from the remote repo to the local. (For learning more about how to open Git Bash and set path, visit this tutorial)Īfter adding the origin, let us run the git pull command for downloading the remote repo: Use this command to add the origin to our newly created remote repository:Ĭhange the URL if you are using some other repo. I will explain this after completing the pulling command below.įor downloading the remote repo content, run the Git pull command as follows. While our topic is Git pull, why I used two other command names in above heading? This is because the pull Git command is the combination of fetch and merge commands. Our pull operation shows some “substance” after we download in our local repository, I have added a few files in the master branch as shown below.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |