Hi Everyone, I have developed many utilities to automate things up for us in my local machines and I have lost a lot of them. We as a developer usually code develop our own utilities to increase our productivity and use our artistic mind and practice a lot of code in home, office, workshops etc.
We generally keep our repository in our local machines. But sometimes due to system failure, we lose our best works which no1 is aware or project you were working on. Usually, big organization uses a Source Control system to avoid this vandalism like SVN, TFS, Bit Bucket, GitHub etc. With the advent of GitHub and Bit bucket, it’s is easy for developers to keep his magic work to be saved in the cloud that to private to him.
So as a best practice we should save all our work in cloud repositories e.g. Bit Bucket, GitHub where we can make some open source or keep our repositories private as well. So that if we need them any time anywhere without our local machine we can access the magic code anytime. This is not rocket science I am telling you, but I usually tend to forget a lot of things on a daily basis just to keep up with pace upmarket updating yourself again and again. Today I want to add my existing demo application to Bit Bucket source control. So I want to share this basic practice we should.
I have been learning a lot about Parallel Programming in .NET so I have created a whole lot of sample application on the same and kept in my local machine. I don’t want my hard work to be gone in vain so I want to save this local repository to my Bit bucket account rather than saving the same on hard drives and searching them when I even forget their name. In order to add your project to Bit Bucket, we need to first create a BIT bucket account.
You can create the same from the below link:
“Img Source: https://www.google.co.in/imgres?imgurl=http%3A%2F%2Fi.qkme.me%2F3u48x0.jpg&imgrefurl=http%3A%2F%2Fwww.maheshsubramaniya.com%2Farticle%2Fwhy-personal-projects-need-version-control-systems.html&docid=Ssbbrfe1VeAyPM&tbnid=79DFcn53k7_GaM%3A&vet=10ahUKEwiiodHy_v_aAhXBu48KHeLnANwQMwg4KAUwBQ..i&w=430&h=539&safe=active&bih=662&biw=1366&q=source%20control%20meme&ved=0ahUKEwiiodHy_v_aAhXBu48KHeLnANwQMwg4KAUwBQ&iact=mrc&uact=8″
Once you are done setting up the account. Now I want to add the repository my account. We need to follow below steps one by one.
- Create Private or Public Repository
- Name your Repository Name
- Now add your solution to the Bit bucket following below steps
Go to the project location in GIT Cmd. You need to download the same for interacting with Git and sync your account after signing up in Bit bucket.
Copy paste the origin address of Repository from the Bit bucket website as shown above.
Commit your solution to bit bucket in Visual Studio
Commit all changes and then push the changes from visual studio or command prompt as shown below:
It will ask for Bit Bucket Credentials as shown below:
Now if you go to your repository, you will see that a master branch has been created with all the files over there. Now you can pull your branch from anywhere and push the new changes from anywhere with different branches.
Guys you have seen how simple it is to sync all your local repos to bit bucket commit and never lose them again if system crashes.
I hope this small tip that I usually use will be helpful to getting starting to save your workshops easily. Happy Coding!