GitHub is one of the most popular Version Control Software in the software industry. And also popular with software developers because of its simplicity, beginner-friendly, and a lot of functionality that developers love.
One of the most valuable functionality is showing the account's activity. And even a lot of company asks to provide candidates GitHub profile for consideration. For that, it becomes important to show your activities there.
But the problem is, GitHub isn't the only solution out there. There is Bitbucket, GitLab, and many more for Version Control. So, let's say your company is using Bitbucket instead of GitHub. Using them is pretty much the same with git-bash. But in GitHub, that won't be recorded as an activity. That's problematic because you also need to show the activities on GitHub.
So, how can you make your Bitbucket activities visible in GitHub as well?
You can find some tools to do that, But you can also solve the issue using PowerShell.
And I found it very easy and useful.
So you can run the below code to do all things at once.
git clone --mirror https://user-name@bitbucket.org/some-app.git ; cd .\some-app.git ; git remote rename origin bitbucket ; git remote add origin https://github.com/user-name/github-version.git ; git push origin master ; cd .. ; Remove-Item ".\some-app.git" -Recurse -Force
Alert You should have a repo dedicated to the project you are transferring. Replace the some-app.git
to your [repo name].git, and change the user-name
to your user name. And that's it, you are good to go.
If you want to know more about what's going on? Then, read below.
So, let me break down the steps for you to understand what's going on there,
So first of all, you are pulling your code from Bitbucket to your Local machine by using git clone --mirror https://user-name@bitbucket.org/some-app.git
.
Note: Use your repo link instead of https://user-name@bitbucket.org/some-app.git
.
After that, what we are doing is we are just going to that directory we just pulled out from Bitbucket by cd .\some-app.git
Note: use the .\some-app.git
should be your [repo name].git
.
Now, It's time to get excited. Because we are gonna be pushing this to GitHub.
So first, we are changing the origin
of the project (origin
is something that tells in which Version Control Software is the item has been stored ) by git remote rename origin bitbucket
.
Secondly, we are adding the origin to a Github repo by git remote add origin https://github.com/user-name/github-version.git
.
Note: You should have a Github repo dedicated to the project and change the https://github.com/user-name/github-version.git
link to your repo link.
Thirdly, we are pushing the codes to Github by git push origin master
.
Finally, we are gonna be cleaning the files/folders in your local machine by cd ..
going back to the parent folder and removing all files by Remove-Item ".\some-app.git" -Recurse -Force
.
Bonus, You can do the same to add your contribution from GitLab to Github with the same process but instead of bitbucket or bitbucket repo link add gitlab and gitlab repo link.
Please let me any questions in the comment. And please share.
Thanks,
Akhlak Hossain Jim
Top comments (0)