Adopting GIT – One Repo for One Project #Web Development #By Sayed Ahmed

Just trying to plan on how to adopt the model of Git based development for all of different Justetc projects.

Still, testing, though found this resource to be useful : http://nvie.com/posts/a-successful-git-branching-model/

Rather than creating a central repository with all projects, so far, planning to create separate repository for each project (did not put any thought on it yet, good or bad). As for test, I am using Bitbucket. It can end up being something not in the internet.

 

So how did I do it

Sure, created a folder in my workstation/pc

used ‘git init’ command on it

then created a repo in Bitbucket using create repo

At PC used a command similar to :

git remote add origin https://sayedjustetc@bitbucket.org/sayedjustetc/test.git

Added a readme.txt file and pushed that to Bitbucket

git add readme.txt
git commit -m 'Initial commit'
git push -u origin master

This will create the master branch (in Bitbucket as well).
Then in Bitbucket from my account created another branch called develop (from master)
Then at pc executed: 
git fetch && git checkout develop


Followed the instructions from  http://nvie.com/posts/a-successful-git-branching-model/
and then created a feature branch under develop. In this feature branch, added all initial code.
committed all these files. Went to the develop branch (checkout). Then merged the feature branch 
to the develop branch. And then deleted the feature branch. Then 
pushed to Bitbucket (develop) branch. So, develop branch will be ahead of master branch. I did not 
but if I wanted to carry these changes to  master, I could just push to master.

git checkout -b initial-file-addition develop
git add * (before this, copied all files to be added to the repo)
git commit -m "added all files"
git checkout develop git merge --no-ff initial-file-addition
git branch -d initial-file-addition
git push origin develop
--

You can do similar experiments with release and hotfix branch concepts as mentioned in the referred 
article.

From: http://sitestree.com/?p=1111
Categories:Web Development, By Sayed Ahmed
Tags:
Post Data:2014-06-27 02:00:15

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses:http://Training.SitesTree.com
Blog: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada