Legacy GM Source control with git [Solved]

Brenden

Member
I followed a tutorial from the official GM:S page https://help.yoyogames.com/hc/en-us...-1-GameMaker-Studio-Source-Control-Management, finished but when I add all resources from source control box I get an error in the compiler window "fatal: not a git repository (or any of the parent directories): .git"
Here is some useful info


I initialized a repository in a separate location on a separate hard drive, D:/RPG Using the git bash application.
The folder RPG is empty however.
I did edit the SCM config to all the correct settings from the tutorial.
 

FrostyCat

Member
You have to initialize the repository right where the project is, even if you intend for the remote to be on a separate hard drive. Git is a distributed system, unlike SVN.

Assuming that you have already set up D:\RPG as a bare repository, this is what you'd do in the project directory:
Code:
git init
echo SCIfile.txt > .gitignore
git add .
git commit -m "Initial commit"
git remote add origin D:\RPG
git push --set-upstream origin master
 

Brenden

Member
I inputted each line but the last one returned an error
$ git push --set-upstream origin master
Enumerating objects: 353, done.
Counting objects: 100% (353/353), done.
Delta compression using up to 12 threads
Compressing objects: 100% (350/350), done.
Writing objects: 100% (353/353), 109.13 KiB | 946.00 KiB/s, done.
Total 353 (delta 54), reused 0 (delta 0)
remote: Resolving deltas: 100% (54/54), done.
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: is denied, because it will make the index and work tree inconsistent
remote: with what you pushed, and will require 'git reset --hard' to match
remote: the work tree to HEAD.
remote:
remote: You can set the 'receive.denyCurrentBranch' configuration variable
remote: to 'ignore' or 'warn' in the remote repository to allow pushing into
remote: its current branch; however, this is not recommended unless you
remote: arranged to update its work tree to match what you pushed in some
remote: other way.
remote:
remote: To squelch this message and still keep the default behaviour, set
remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To D:/RPG
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'D:/RPG'
I tried the git reset --hard but got the same error when trying again.
For the rest I have yet to try because I don't know how to type that into git.
 

Brenden

Member
I did some messing around. And I got the push to work.
I deleted the D:/RPG rep and used "git init --bare RPG.git" to create a bare rep in its place. I had to remove the old remote and set the new one to D:/RPG.git and that did it. I pushed and got this beauty.
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.

Thanks for your help!
 
Top