Reputation: 13
I am new to git and I have difficulty understanding some functioning.
I have 1 production server, 1 staging server and 1 development machine.
Of these 3 machines, I have the sources of the application. I would like to connect each machine to the repo git I created and more precisely, I would like to create 3 branches (master, staging, prod) and connect the production server to the prod branch, staging server to staging branch and development machine to the master branch.
I can not create this system and import the sources into the branches ... I'm lost with git commands...
Please, how can I proceed ?
Upvotes: 1
Views: 279
Reputation: 5444
git init
to initialize a git repo.the repo is empty. So easily create branches for production
and staging
:
git branch production
git branch staging
the default branch is called master
. So, add your development
code into it.
add the code to git index and commit.
git add .
git commit -m "init development source code"
Checkout the production
branch and repeat steps 3 and 4.
git checkout production
[...]
git add .
git commit -m "..."
Upvotes: 1