Discover the Power of Git Desktop!
Deb
Posted on April 8, 2024
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!
Download Git Desktop now: Donload GitHub Desktop
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.
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.
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.
- 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.
Then I created a branch for making changes without affecting the main branch.
After publishing the branch into the repository.
- 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.
As you can see the changes in the file below, then commit the change to push into our local branch.
Push the changes into the local branch.
The changes that we made.
As you can see in the history tab.
Now let's try to switch a branch by selecting the current branch.
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.
Right-click the changes from local, then select Cherry-pick commit.
Then choose the main branch.
Then click the Cherry-pick ... button below.
Then click push origin.
Now the changes from the local branch are now put into the main branch.
Then what if our main branch has changes?
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.
Then click Update from main.
Then if there is a similar line file change in the file, it will have a pop-up to fix the changes. Example:
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.
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
Posted on April 8, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.