Discover the Power of Git Desktop!

bo_de_0

Deb

Posted on April 8, 2024

Discover the Power of Git Desktop!

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

  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

Image description

  1. 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

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

Image description

After publishing the branch into the repository.

Image description

  1. 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

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

Image description

Push the changes into the local branch.

Image description

The changes that we made.

Image description

As you can see in the history tab.

Image description

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

Image description

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

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

Image description

Then choose the main branch.

Image description

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

Image description

Then click push origin.

Image description

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

Image description

Then what if our main branch has changes?

Image description

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

Then click Update from main.

Image description

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

Image description

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

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
Roman Synkevych on Unsplash

💖 💪 🙅 🚩
bo_de_0
Deb

Posted on April 8, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related