<p>This article might be of use to you: <a href="https://nystudio107.com/blog/setting-up-a-craft-cms-3-project" rel="noreferrer">Setting up a New Craft CMS 3 Project</a></p>

<p>The <strong>DEPLOYMENT</strong> section talks about using Composer to install our dependencies, and not checking them into Git. That means a <code>.gitignore</code> that excludes <code>vendor/</code></p>

<p>This isn't really a right or wrong situation, but rather that the advantages slightly outweigh the disadvantages, imo.</p>

<p>If you want to see this all live in action, you can see the <a href="https://github.com/nystudio107/devmode" rel="noreferrer">devMode.fm website Github repo</a> which is an OSS example Craft CMS website that powers the <a href="https://devmode.fm/" rel="noreferrer">devMode.fm</a> podcast.</p>

CC BY-SA 4.0
2019-11-14T01:10:23.207Z
Thanks for the reply Andrew, I've just been reading through your blog post, it says about in live production put the database variables etc into your webserver config instead of using .env, what do you mean by that? Sorry if it's a dumb question.
Third_Hyperion
CC BY-SA 4.0
2019-11-14T01:11:05.507Z
That's a very optional thing to do; I'd stick to `.env` for now. More on that here: https://github.com/nystudio107/dotenvy
andrew.welch
CC BY-SA 4.0
2019-11-14T01:16:55.190Z
ok so stick with the .env for now, am I right in thinking, that I manually create the .env files on the server for dev, staging live and just make sure they're git ignored and not in the repository?
Third_Hyperion
CC BY-SA 4.0
2019-11-14T01:52:02.603Z
You are correct.
andrew.welch
CC BY-SA 4.0
2019-11-14T00:25:57.913Z
2019-11-14T00:25:57.913Z
andrew.welch
<p>New to Craft and general novice full stop. I'm not sure about the correct way to use craft and git together. I currently use BitBucket for version control and have been using ExpressionEngine... so installing Craft and understanding the proper workflow is a bit confusing to get my head around.</p>

<p>I installed Composer locally and ran the command to install Craft 3, but then I just ended up putting all those files into BitBucket and then connecting that with my server, I created a database and then installed Craft on the server instead of locally. I have a feeling that's the wrong way to go about it, especially after reading that I shouldn't be putting the .env file in version control (which I can't understand?? if the .env file doesn't make its way to the server how does Craft know what database, etc. to connect to?)</p>

<p>Can anyone tell me or point me in the right direction to how I can learn the propper/correct flow and setup? </p>

<p>Thanks</p>

CC BY-SA 4.0
2019-11-14T19:20:21.007Z
I'd suggestion looking at https://mijingo.com and working through some tutorials.
4midori
<install><setup><workflow><git>
Correct setup for Craft 3 and Git
# Correct setup for Craft 3 and Git

(Asked by: username_0 on 2019-11-13)

New to Craft and general novice full stop. I'm not sure about the correct way to use craft and git together. I currently use BitBucket for version control and have been using ExpressionEngine... so installing Craft and understanding the proper workflow is a bit confusing to get my head around.

I installed Composer locally and ran the command to install Craft 3, but then I just ended up putting all those files into BitBucket and then connecting that with my server, I created a database and then installed Craft on the server instead of locally. I have a feeling that's the wrong way to go about it, especially after reading that I shouldn't be putting the .env file in version control (which I can't understand?? if the .env file doesn't make its way to the server how does Craft know what database, etc. to connect to?)

Can anyone tell me or point me in the right direction to how I can learn the propper/correct flow and setup?

Thanks

**Tags:** install, setup, workflow, git

> **Comments:**
> **username_1**: I'd suggestion looking at https://mijingo.com and working through some tutorials.  

---

## 1 answers

### Answer by username_2 on 2019-11-14. Score: 5 | Accepted answer

This article might be of use to you: [Setting up a New Craft CMS 3 Project](https://nystudio107.com/blog/setting-up-a-craft-cms-3-project)

The **DEPLOYMENT** section talks about using Composer to install our dependencies, and not checking them into Git. That means a `.gitignore` that excludes `vendor/`

This isn't really a right or wrong situation, but rather that the advantages slightly outweigh the disadvantages, imo.

If you want to see this all live in action, you can see the [devMode.fm website Github repo](https://github.com/nystudio107/devmode) which is an OSS example Craft CMS website that powers the [devMode.fm](https://devmode.fm/) podcast.

> **Comments:**
> **username_0**: Thanks for the reply Andrew, I've just been reading through your blog post, it says about in live production put the database variables etc into your webserver config instead of using .env, what do you mean by that? Sorry if it's a dumb question.  
> **username_2**: That's a very optional thing to do; I'd stick to `.env` for now. More on that here: https://github.com/nystudio107/dotenvy  
> **username_0**: ok so stick with the .env for now, am I right in thinking, that I manually create the .env files on the server for dev, staging live and just make sure they're git ignored and not in the repository?  
> **username_2**: You are correct.  

---

