Discover the Power of Git Desktop!
Tags: git, development, productivity, gitdesktop
Published: 2024-04-08 08:08:06


Simplify your workflow, collaborate seamlessly, and unleash the full potential of version control with Git Desktop. Whether you're a seasoned developer or just starting your coding journey, Git Desktop provides an intuitive interface for managing your Git repositories effortlessly.

Say goodbye to command line complexities and hello to a user-friendly experience that empowers you to focus on what you do best – writing code. Join the Git Desktop community today and elevate your development process to new heights!


1. **Download Git Desktop now:** [Donload GitHub Desktop](https://desktop.github.com/)

2. **Sign in to Your GitHub Account:** Open GitHub Desktop and sign in with your GitHub account. If you don't have one, you can create a new account for free.

3.  **Configure Git:** If you haven't already configured Git on your computer, GitHub Desktop will guide you through the process. You'll need to provide your name and email address, which will be associated with your Git commits.

4. **Clone a Repository:** To start working with a repository, you can either create a new one or **clone an existing repository from GitHub**. To clone a repository, click on the "File" menu and select "Clone Repository." You can then choose the repository you want to clone from your GitHub account.

**Copy & Paste.**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e1jkw45xd01mg06jtmh3.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f8uumjwhm1akss3344em.png)

5. **Open a Repository:** Once you have cloned a repository, you can open it in GitHub Desktop by selecting it from the list of repositories on the left side of the application window.

I created a file: index.html for the main branch. Then I committed it.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b2ok5adg78kou3hy87pi.png)

Then I created a branch for making changes without affecting the main branch.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bxj56842zp6821dy7ya5.png)

After publishing the branch into the repository.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2kylcy393zh0skqo0df6.png)

6. **Make Changes:** You can now make changes to the files in your repository using your preferred text editor or IDE.

I used VSCode for the IDE.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xpdkmifvp15ng0ztrcjj.png)

As you can see the changes in the file below, then commit the change to push into our local branch.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rwlcuk6e1gwhxr0uygwg.png)

Push the changes into the local branch.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iob4r1qo6vl8f9ysnx2k.png)

The changes that we made.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jeadrhks7bo59cr1kzi9.png)

As you can see in the history tab.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yh0r5cv1yvq0jn6001xa.png)

Now let's try to switch a branch by selecting the current branch.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p3zzja26dyphvyjni0bx.png)

The changes that we made in our local branch were not put into our main branch. So to push the changes into the main branch from our main branch, before switching branches make sure that our current branch is updated by clicking the fetch origin tab to fetch all the updated commits from the main branch. Then switch to the local branch, so we can merge the changes into the main branch.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l4xn0nkm50vcpjbponkn.png)

Right-click the changes from local, then select Cherry-pick commit.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sahjfd4w993bonbncs6q.png)

Then choose the main branch.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ylnn5ox07iuc6frltpvc.png)

Then click the Cherry-pick ... button below.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8mh9tyjeo6jnj3w5yx3s.png)

Then click push origin.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kiq40l6nzfczmoaq0xpt.png)

Now the changes from the local branch are now put into the main branch.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kiexrbvq9d2axbi50mq2.png)

Then what if our main branch has changes?

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nyvdm05f6ac75tjmprln.png)

Then we are on our current local branch, so there may be a conflict. To resolve the conflict, update the local branch by simply clicking the Branch tab tool above.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b6ro86y1dm3ba740tbtx.png)

Then click Update from main.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3kvnfg0zvt1zh54b1rne.png)

Then if there is a similar line file change in the file, it will have a pop-up to fix the changes. Example:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rv8fl8oaurkm1e3qiau1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/71jto3qyrms35h9sewzp.png)

I click the upcoming changes since the update is from the main branch to the local.

After solving the conflict, it will pop up again, just click continue merge then we can now click push origin to our local branch.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kqqj0capiopud6hduf77.png)

Now your local branch is updated from the base branch which is the main.

Thank you so much! Hopefully, it can help. I just leave it here.


Cover Photo by 
<a href="https://unsplash.com/@synkevych?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Roman Synkevych</a> on <a href="https://unsplash.com/photos/black-and-white-penguin-toy-wX2L8L-fGeA?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Unsplash</a>