Tag: bash

Git push to master repo then send the dist folder to a specific path(/www/site/v0.0.1)?

So the goal is to push my project to a core repo, where all my development files live, for backup purposes. Then I want to send the dist folder to a directory like www/site.com/v0.0.1, for demonstration purposes, no development files are needed, it would just cause bloat because I have multiple directories. So what I […]

Adding existing key for Git in Cygwin

I have my key set up as inpdenedent GIT installation for our local repo. I can do all git commands from git bash prompot. Recently, I installed cygwin and want to use git from there. I tried running ssh-add command and it didn’t work … see below user@computer_name /cygdrive/d/folder/cheftesting $ ssh-add /cygdrive/c/Users/user/.ssh/id_rsa 0 [main] ssh-add […]

Sparse Checkout in LibGit2Sharp

Is there a way to do sparse checkout with Lib2GitSharp? I used this question (2nd answer) as a reference, executed it manually with git bash and it worked. The problem is that in this answer the command ‘git pull origin master’ is executed, and in the Lib2GitSharp I wasn’t able to find an exact equivalent […]

Git post commit and bash on windows

I want to copy all the *.obj files (ignored by the git, but present in the directory) after commit to a directory. With this script: #!/bin/sh pwd branch=$(git rev-parse –symbolic –abbrev-ref HEAD) echo logging objfiles for $branch mkdir -p ./OBJ_$branch/ cp -u -f -r *.obj ./OBJ_$branch/ Git says after commit, that “Cannot stat *.obj” Ia […]

Automatically create github repo, cool. But how to automatically do first commit

I’m writing a bash script to automatically setup a private github repo, as well as setup a deployHQ project for the same. This works well. However I can not add the GitHub repository to deployhq (via bash script using curl api calls) seemingly because I figure that there hasn’t been an initial commit yet. The […]

How to apply an old commit on Git?

So, I’m trying to apply an old commit by using cherry-pick, but seems more difficult than I thought. This is what the BASH looks like… –HEAD IS IN THE MASTER BRANCH- git cherry-pick 6a0c632 error: could not apply 6a0c632… hint: after resolving the conflicts, mark the corrected paths hint: with ‘git add <paths> or “git […]

git credential.helper does not store username password

I am writing a deployment script which clones a git repo and then performs other tasks such as fetch etc .I have run this git config –global credential.helper cache The username and password for cloning step are provided by an expect script. But these details are not cached as it should be.The script again prompts […]

Ruby chmod works, but not for one directory called “js/”

I’ve been putting together a ruby script that delpoys a git repository on my webserver (running gitolite) with a post-recieve hook. After checking out the files I try to chmod the directories first, and the files after like this: FileUtils.chmod_R(0755, Dir.glob(“#{deploy_to_dir}/**/*/”)) FileUtils.chmod_R(0644, Dir.glob(“#{deploy_to_dir}/**/*”)) The first command works for all directories but one: js/. It just […]

Nginx git server returns error 500

I’m trying to set up an nginx remote server (with ssl) for a bare git repository, but getting error 500 when trying git clone https://my.domain.com/repo.git from git bash (windows 7 machine). My current configuration looks like this. Nginx server config: server { listen: 80; server_name my.domain.com; # Redirect all non-HTTPS traffic to the HTTPS version […]

How to write a bash script that creates a new folder version?

I guess git is not a deployment tool, however, for the last year I have been using git checkout -f inside post-receive without any issues. post-receive hook #!/bin/sh git –work-tree=/var/www/domain.com –git-dir=/var/repo/site.git checkout -f Now I want to further things by doing some version control & git tagging. For example I have an updated version of […]

Git Baby is a git and github fan, let's start git clone.