Monday, June 23, 2014

Journey From Bare Folder To Git Repository On Stash

Hi,

In IT/CS profession, I won't be surprised if you tell me that you came across new technologies every single day at work. Same is the case with me.

Following is the procedure that I followed to convert a bare folder into a repository:
(Assume folder name = "repo")

  1. git clone --bare repo repo.git
  2. Now you can delete or move the repo folder in some other directory
  3. mkdir repo
  4. cp repo.git repo/.git
  5. cd repo
  6. git config --bool core.bare false
  7. git checkout master
  8. Okay! You are ready with a repository on your machine. That was a quick recipe, wasn't it? 
Lets have this repository on Stash (For those who haven't used Stash - It is a tool to maintain repositories, one place to commit code, tag a project, etc. You can read more about it here: https://www.atlassian.com/software/stash ) Procedure to have the existence of your git repository on Stash:
  1. Login to Stash. Get the right permission to mingle around with Stash from your admin.
  2. In Stash, go inside the project, where you want to create a repository.
  3. Click on "Create Repository" button. (You can see this button only if you have the right permissions)
  4. Now, open a terminal on your machine(in which you have created the repository from the above steps).
  5. cd into the "repo" folder/repository made in the above process. 
  6. Now copy-link on new created repository in stash. 
  7. git remote set-url origin <paste-link>
  8. git push --all origin
  9. git push --tags origin
We are done:) Have a good day!

PS: Post your questions. I will surely try to ans and if not me someone else will :P