I've got a system setup so that people can clone a repo on the server, work on it, and when finished push it back to the server. This repo then does a git checkout to the actual 'webfolder'.
But since the framework used it Laravel, and it could be that someone made changes to the composer.json file, I would like to run composer update right after the push (on the 'webfolder')
System is Windows Server 2008 R2.
Is this possible? I've tried to put something alone the lines of this in de post-receive hook, but that didn't work:
#!/bin/sh
GIT_WORK_TREE=C:/inetpub/wwwroot/website git checkout -f
C:/inetpub/wwwroot/website composer update
EDIT:
First I got no output at all, but now I got output that C:/inetpub/... was a file, so I changed it to this:
#!/bin/sh
GIT_WORK_TREE=C:/inetpub/wwwroot/website git checkout -f
cd C:/inetpub/wwwroot/website
composer update
But that also doesn't work, cause now I get bunch of error stuff which is dumped to a file called sh.exe.stackdump. And the only useful thing that file tells me is Exception: STATUS_ACCESS_VIOLATION. So I think it has something to do with permissions?
Related
extension: GitHub Pull Requests and Issues
Don't know why its behaving like this, git is installed... still its saying install git
showing:
Activating the Pull Requests and Issues extension failed. Please make sure you have git installed.
Go to setting and search git path
edit the setting.json in there, the last parameter git.path
find the git path with this command in terminal
which git
then reload the VS Code
I have a git pre-commit hook script to validate certain thing during commit.
This in my script .githooks/pre-commit
#!/bin/bash
echo "Here I am!"
This is the file permission
In ubantu when I am committing anything I am able to view the echoed message, where as when I doing the the same thing in MacOS I am getting this error
fatal: cannot run .githooks/pre-commit: No such file or directory
git config is .git/config
line break type is CRLF
Also when I am directly running the file (in MacOS) from CLI like this, it is giving me the desired output.
./.githooks/pre-commit
My git version is 2.32.0 (Apple Git-132)
could you please try this and see if it's working for you?
brew link --overwrite git
brew update git
You should have the latest version of git -> 2.35.x
Now go to your local repository, i.e. the project folder, and then to the .git/hooks directory under your project folder.
You can place your hook files here. I.e. for pre-commit, the file name should be pre-commit (without any extension).
This should work whenever you try to commit to that specific repository. The main problem in your case seems to be the directory. The hooks should be in the .git/hooks directory of the project folder.
See the screenshots below.
I have a local folder which I wanted to convert to a Git repository and then push to a remote repository. I ran the command git init in the project folder and then used the command git add .. When I run the command git status, I get the message that I have untracked files. I ran the git add . command multiple times but I see the same message.
What should I do to track these files so I can push to a remote repo?
I'm using Windows 8.1 x64 machine.
UPDATE: Please see the answer below.
I used the command git config --system core.longpaths true to fix the error for longer file names. I was able to add all files after making that change.
I want to create a wiki with gollum and push it to my own git repo, is that possible?
I created a new git repo, install gollum and started it. I got the "edit/Home" page. I added some content, saved...all looked good. Even the "revision history" showed that revisions occurred.
Then I stopped gollum and found there was nothing new in my git repo, I even checked if stuff hadn't been pushed...nothing. I'm not sure how/where it's storing the content that I add when I run it.
Any ideas?
Thanks
Gollum will not sync with a git remote. It will never perform git pull or git push. You must have gollum running on the remote server, or you must manually run git push on machines where you make edits, and git pull on machines who also want to see the wiki. This could be part of a cron job if you're running locally.
It is much easier to have the gollum process running on your web server. See below for more information:
http://www.nomachetejuggling.com/2012/05/15/personal-wiki-using-github-and-gollum-on-os-x/#toc-synchronization-with-github
May be you are checking a wrong repository, the default is for gollum to use or create a git repository at the root of page files. It can be changed with the options --page-file-dir and --base-path (cf gollum --help)
I am very new to the terminologies: git, repository and cloning.
I was able to search them all online and get pretty good grip on each (pretty simple stuff!).
But what I am trying to figure out now is how to "run" these instructions:
Clone repository for app:
git clone git://github.com/SampleLink.git
Update submodules:
git submodule update --init
I am running Windows7. I tried to run init through command prompt, but no luck.
Are these supposed to be run as individual commands or as one following the other in sequence automatically?
I am just not sure how to run these on my Windows machine and cannot seem to get any of it to work.
The submodule is a file within the initial repository.
I'm sorry if this is a lame question, but I have never needed to run this type of setup before.
I would recommend installing msysgit in its "Git for Windows" instance:
Git-1.7.3.1-preview20101002.exe
I like using Option 2, only adding the git\bin directory to the PATH environment variable, but without overriding some built-in windows tools.
From there, git clone over http should work.