# Create Template without version control

**URL:** <https://discourse.julialang.org/t/create-template-without-version-control/64450>\
**Category:** Performance\
**Tags:** pkgtemplates\
**Created:** [July 11, 2021, 3:52am UTC](https://discourse.julialang.org/t/create-template-without-version-control/64450 "2021-07-11T03:52:34Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dustin\_Hess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dustin_hess/32/11957_2.png) [@Dustin\_Hess](https://discourse.julialang.org/u/Dustin_Hess)\
**Post date:** [July 11, 2021, 3:52am UTC](https://discourse.julialang.org/t/create-template-without-version-control/64450/1 "2021-07-11T03:52:34Z")

</div>

I read through the doc for PkgTemplates and cannot figure out how to create a package that dose not have a .git folder. I need this way because because I am using Bitbucket and packages are private. Bitbucket will create the .git versioning for me. Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [July 11, 2021, 4:56am UTC](https://discourse.julialang.org/t/create-template-without-version-control/64450/2 "2021-07-11T04:56:42Z")

</div>

> [@Dustin\_Hess](#):
>
> Bitbucket will create the .git versioning for me.

You can just override that. Create the package, point the remote to your bitbucket repo and push.

Edit: this can be done from the start with `Template(;host="bitbucket.org")`

---

<div class="post-metadata">

**Author:** ![Dustin\_Hess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dustin_hess/32/11957_2.png) [@Dustin\_Hess](https://discourse.julialang.org/u/Dustin_Hess)\
**Post date:** [July 11, 2021, 3:57pm UTC](https://discourse.julialang.org/t/create-template-without-version-control/64450/3 "2021-07-11T15:57:01Z")

</div>

Hi gustaphe thanks for the reply. I tried that. Template still creates the .git folder. See below.

```julia
using PkgTemplates

t = Template(;
    user="username",
    host="bitbucket.org",
    dir="/home/dustin/Git/Projects/",
    authors="Dustin",
    julia=v"1.6.1",
    plugins=[
        License(; name="MIT"),
        Develop(),
    ],
)

t("Test")

```

 ![PkgTemplate](https://global.discourse-cdn.com/julialang/original/3X/f/6/f646dc5524c8f990cb264a344667cd9409c2bdb9.png)

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [July 11, 2021, 4:05pm UTC](https://discourse.julialang.org/t/create-template-without-version-control/64450/4 "2021-07-11T16:05:57Z")

</div>

Yes, you _want_ a `.git` folder. Just run `git add -A; git commit -m "initial commit"; git pull; git push` and you’ll be fully synched.

Edit: must add all the first time. Always forget.

---

<div class="post-metadata">

**Author:** ![Dustin\_Hess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dustin_hess/32/11957_2.png) [@Dustin\_Hess](https://discourse.julialang.org/u/Dustin_Hess)\
**Post date:** [July 11, 2021, 4:06pm UTC](https://discourse.julialang.org/t/create-template-without-version-control/64450/5 "2021-07-11T16:06:59Z")

</div>

Thank you. I will give this a try and reply back.

---

<div class="post-metadata">

**Author:** ![Dustin\_Hess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dustin_hess/32/11957_2.png) [@Dustin\_Hess](https://discourse.julialang.org/u/Dustin_Hess)\
**Post date:** [July 11, 2021, 6:39pm UTC](https://discourse.julialang.org/t/create-template-without-version-control/64450/6 "2021-07-11T18:39:08Z")

</div>

Hi gustaphe none of that worked. You have to create a repo in bit bucket but it already configures a master/rorigin and you can not change it. Then Template() generates a url based on the info you provide it, then it auto outputs a .jl. See below url in the .git config, which is wrong.

 ![Screenshot from 2021-07-11 13-22-03](https://global.discourse-cdn.com/julialang/original/3X/b/6/b63e10362073bde0f9518a0ef5719b38fdd6c1ea.png)

Navigating to the project root folder and ruining git command results int wrong url used even after explicitly defining the remote url to push and pull from.

```julia
[dustin@Odin-pc Test]$ git push -u origin master
Username for 'https://bitbucket.org': dustinthomas
Password for 'https://dustinthomas@bitbucket.org': 
remote: The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you're authenticated.
fatal: repository 'https://bitbucket.org/dustinthomas/Test.jl/' not found

```

because the url is wrong the repo doesn’t exist. So I change the Git() option to

```julia
Git(; jl=false)

```

and I get the same result. I have no idea why changing to the root directory of my project would result in git automatically looking form wrong repo especially when i explicitly tell it the url use.

```julia
git remote add bitbucket https://dustinthomas@bitbucket.org/dustinthomas/test.git

```

So eventually, I use the official tutorial on the Bit bucket website see bellow.  
however because bit bucket doesn’t create a bare repo you need to modify the

```julia
git push --all bitbucket  

```

to

```julia
git push --all --force btibucket 

```

[https://confluence.atlassian.com/bitbucketserver/importing-code-from-an-existing-project-776640909.html](https://confluence.atlassian.com/bitbucketserver/importing-code-from-an-existing-project-776640909.html)

 ![Screenshot from 2021-07-11 13-24-45](https://global.discourse-cdn.com/julialang/original/3X/d/5/d5b2b489a3a856adfc5ebb74564ec7f8a287ec02.png)

So in the end I am not sure if this git problem or a Templates problem. I have a workaround but it is not ideal to say the least. If this is a problem with PkgTemplates we should make the package creators aware. If it’s a lack knowledge on my part I happy to learn / change what I am doing.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [July 11, 2021, 6:52pm UTC](https://discourse.julialang.org/t/create-template-without-version-control/64450/7 "2021-07-11T18:52:30Z")

</div>

You don’t need to force push, you just need to pull and resolve any merge conflicts before you push. I haven’t used bitbucket in a hot while, so I don’t know what stuff it puts in its repos by default, but this is a good general concept to know in git: you can’t push to a repo if there are changes in the remote that you don’t have locally.

---

<div class="post-metadata">

**Author:** ![Dustin\_Hess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dustin_hess/32/11957_2.png) [@Dustin\_Hess](https://discourse.julialang.org/u/Dustin_Hess)\
**Post date:** [July 11, 2021, 7:17pm UTC](https://discourse.julialang.org/t/create-template-without-version-control/64450/8 "2021-07-11T19:17:07Z")

</div>

Ok Let me give it a try again from scratch. See if it works

---

<div class="post-metadata">

**Author:** ![Dustin\_Hess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dustin_hess/32/11957_2.png) [@Dustin\_Hess](https://discourse.julialang.org/u/Dustin_Hess)\
**Post date:** [July 11, 2021, 9:43pm UTC](https://discourse.julialang.org/t/create-template-without-version-control/64450/9 "2021-07-11T21:43:51Z")

</div>

The problem was bitbucket was creating a .gitignore which is created by the template when creating the local repository. So I configured the bitbucket repository to not create this file. Then I used

```julia
git remote set-url origin <bitbucket_URL>

```

to set the correct repository url. Then

```julia
git push -u origin --all

```

This worked.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [July 12, 2021, 4:55am UTC](https://discourse.julialang.org/t/create-template-without-version-control/64450/10 "2021-07-12T04:55:42Z")

</div>

That too would be no issue if you followed my suggestion, because upon pulling the remote you would have been offered a choice of which (parts) of the two `.gitignore`s to keep. But I’m glad it worked out.

---

<div class="post-metadata">

**Author:** ![Dustin\_Hess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dustin_hess/32/11957_2.png) [@Dustin\_Hess](https://discourse.julialang.org/u/Dustin_Hess)\
**Post date:** [July 15, 2021, 3:22am UTC](https://discourse.julialang.org/t/create-template-without-version-control/64450/11 "2021-07-15T03:22:19Z")

</div>

You are correct sir. Help was much appreciated.
