Notes on using Git GUI and Github Desktop
Last updated on 30 Apr. 2024
30 Apr. 2024
Went through the following video, once again. Last time I saw it, perhaps a few months ago, I was quite new to git, GitHub and GitHub Desktop. Git, GitHub, & GitHub Desktop for beginners, https://www.youtube.com/watch?v=8Dd7KRpKeaE, 22 min. 15 secs, published by Coder Coder in Feb. 2022. This time around, most of it was a breeze. About the stuff that I have not yet done like reverting, branching, merging and creating pull requests (when working with a team): I could comfortably follow the video but until I do some of these actions myself, I will not be sure about these actions.
This viewing time, I found the co-ordination between GitHub Desktop and GitHub to be very interesting. I do think that creating a local repo using GitHub Desktop (including options to create README and license files) and then creating a repo on GitHub and pushing to it using GitHub Desktop are easy and smooth operations as compared to the git commands mixed with operations on GitHub website that I have followed as part of many project tutorials. GitHub Desktop also has a convenient button to open up the repo/project in Visual Studio Code.
Earlier on, I used Git GUI to easily list commits and view the specific changes in a commit, for local repos. As it has a GUI, I find that much more convenient that using git commands for that info.
I think GitHub Desktop is an interesting alternative to Git GUI especially for those local repos that are pushed to GitHub. Note that if the local repo has been pushed to GitHub, the GitHub website GUI is also good to conveniently see changes made in a particular commit.
...
Tried out reverting changes in last commit. It is straightforward using GitHub Desktop (GHD). VSCode immediately reflecting the changes is great!
Created new branch dev1 in GHD. dev1 is automatically made the current branch in GHD and in VSCode. Added a new file and modified earlier files in VSCode and committed the change using GHD. Pushed it to GitHub (the tutorial video does not do this push to GitHub of new branch commit). Straightforward again! GitHub shows two branches and an option button to 'Compare & pull request'.
Merging dev1 into main is slightly more cumbersome even in GHD. The steps are:
- Change current branch to main (in GHD).
- Use Branch -> Merge into current branch command and in the dialog that pops up, choose dev1 as the branch to merge into main. Click on 'Create a merge commit' button. The merge is done.
- Push the merge commit to GitHub.
GitHub no longer shows 'Compare & pull request' button on the main branch page. VSCode also shows main branch.
...
Nice video explaining forking a repo, modifying the forked branch, making a pull request, and how the owner reviews the request and merges it in the original (main) branch: How To Pull Request in 3 Minutes, https://www.youtube.com/watch?v=jRLGobWwA3Y, 3 min. 5 secs, published by Keep On Coding in Aug. 2022.
...
Also did some digging up on git commands and am sharing some info. about it below:
'git log' gives list of commits
'git log --stat' gives list of commits and file insertions/deletions count in each commit
'git log -p' lists all changes done in all commits
'git show' followed by commit-id (commit-ids are listed by git log) gives details of files and changes in a commit.
e.g. git show 9da4be17f94a57be5587b4dd64ba6705dfc853fc
==================
1st Apr. 2024
To get Git GUI to work on a particular local directory .git repo:
- Mouse right-click in the directory shows an Open Git GUI here command!
- cd to that directory in command prompt and then specify 'git gui' as the command.
Seems to be useful doc: Getting started with git gui on Windows
I was facing this issue with Git GUI previously and did not have the time to investigate it. Checked it out today and got the above solutions and another solution. The issue: Opening Git GUI from Windows Start/Search leads to Git GUI using current directory as C:\Users\Ravi-user and after some time giving a message of 5000 files limit reached and it seems to be listing all files in that directory as Unstaged! The solution was to delete the .git directory that I seem to have created in C:\Users\Ravi-user many months ago as I was trying out Git and Git GUI. After that opening the Git GUI from Start/Search leads to a different start window giving options to open a new (local) repo or open an existing repo.
...
Github Desktop allows working on local directories. Its user interface is more polished that Git GUI. However, when I ran it after many months, it was very slow which I later understood was, in all probability, because it was auto updating. Once the update got done, it was quite fast. An issue was that I could not close the program in the midst of its long update as it warned of possibly breaking the installation. One person has complained about this problem but there does not seem to be an option for auto update to be disabled.
Comments
Post a Comment