Showing posts with label bitbucket. Show all posts
Showing posts with label bitbucket. Show all posts

Wednesday, November 29, 2017

GitHub Desktop for other providers

GitHub Desktop can be downloaded from GitHub Desktop.
It is provided by GitHub and supposed to use only for GitHub.com
Other providers like BitBucket can’t be used directly with GitHub Desktop.
If we need desktop client for BitBucket, we can use directly the Git software available at Git website, this is the most recommended one and have both command line and GUI versions.
But for people, who are acquainted with GitHub Desktop, they can follow below instructions to use BitBucket and other service providers with GitHub Desktop.
  1. Clone the Bitbucket repo locally via command line.
  2. Add Cloned Repository to Your GitHub Desktop App.
Video Tutorial:
Reference: Main Link

How push or sync commits to a different branch

Let’s say we have created a branch yesterday and committed some changes to master branch.
If we want to make both the branches even.
  1. Option 1 -> is to delete and recreate the branch again from master.
  2. Option 2 -> checkout to master branch and run below command.
    git push origin master:<new_branch>
All the commits are identified by a unique ID.So we don’t need to mention the parent branch of the commit if we know its ID.So, If we want to add only a specific commit, then run below command from the target branch checked out.
git checkout -b new_branch origin/new_branch -> If branch never checked out locally.
git checkout new_branch -> If already checked out locally.
git cherry-pick <commit-ID>
Reference: https://www.devroom.io/2010/06/10/cherry-picking-specific-commits-from-another-branch/