Git workflow - Setting up a build process -
disclaimer: i've been using git while still find confusing.
i'm setting build process project , running problem updating git repository.
i created repository on server, lets c:\myproject. i connected computer repository sourcetree. pull , code, great far. i go create commit error saying: "refusing update checked out branch... default, updating current branch in non-bare repository denied" use google bit, , realize git repository on server shouldn't have master checked out utilize git gui checkout using alternative "detach local branch". sets branch on server head.now part i'm confused (let me know if confused before , don't know it). recommended way go updating code on server? if open server repository in git gui there no alternative fetch. seems work if checkout master, what's recommended? , if is, mean have checkout different branch after each update can go on doing pushes on work computer.
it best practice push bare repo: see "concept of bare shared repository in git" , all "bare" repos -- what, why, , how prepare non-bare push.
which means on server, need to:
create git repo (you did) clone repo bare repo (git clone --bare yourprojectfolder yourprojectfolder.git
) (the .git
extention naming convention bare repo root folder) push bare repo instead: go local repo, , type:
git remote set-url origin /url/repo/repo/yourprojectfolder.git
add hook in bare repo (on server, yourprojectfolder.git/hooks/post-receive
), in
yourprojectfolder
) unset git_dir
git pull ../yourprojectfolder.git
see more @ "remote nodejs server deployment forever".
git build-process
No comments:
Post a Comment