Tag: bash

How can I pass all command line arguments of my bash script as one argument to another program?

I wish to write a simple git script that will run the following lines: cd <the name of my git repo> git add * git add -u git commit -m “<my comment in the form of a string>” git push origin master I’m new to bash scripting, so this has been a bit of a […]

Shell script helper for git commits

I’m trying to write a simple shell script that simplifies the git commit process. Instead of git add . -A git commit -m “message” git push I want to do commit.sh “my commit message” Here’s what I have: #!/bin/bash commit_message=”$1″ git add . -A git commit -m $commit_message git push There’s two problems with this: […]

Can't add a file separated with space to git

I have been writing a script to add untracked files using git add . The loop I use in my script is for FILE in $(git ls-files -o –exclude-standard); do git add $FILE git commit -m “Added $FILE” git push origin master done The script runs fine till it faces a filename which has space […]

SSH – ksh: git: not found

I have GIT running on a Solaris server. From a windows machine I installed cygwin to try to clone a repository hosted on the server. I do the following: $ git clone username@server:project.git ksh: git-upload-pack: not found So I try $ ssh username@server echo \$PATH /usr/bin It seems like git is not in /usr/bin/ but […]

Speed up bash script that uses several find commands

I have a bash script to add some files of a project to git and then synchronize that branch, as the amount of files has increased i have noticed the script has become much slower, so i want to figure out if I’m doing it the correct way. This is the section of the script […]

Creating a git alias to append to .gitignore

I’m using git 1.9.0 on Windows (msysgit) and I have the following alias: ignore = “!f() { echo $1 >> \”${GIT_PREFIX}.gitignore\”; }; f” And I use it like so: $ git ignore /Directory/Subdir/ This should append to my .gitignore file within the current directory, or create it if it doesn’t exist. However for some reason […]

How to create alias for git bash to make fast cd through directories

I’m using git bash and let say i have 2 folders: C:/folder1 and C:/folder2, I’d like to make fast cd from one to another. I’ve tried git.alias but it seems to work for “git …” commands only.. and I’m not very familiar with all this bash stuff.. so how should I do that?

How can I make this git command alias?

I want to make a alias, like this below gc this is a test message convert to git commit -m “this is a test message”. How can I do this? I want that in my bashrc.

Git Bash Slow on Windows 10

This question already has an answer here: Git Bash(mintty) is extremely slow on my windows 10 3 answers

bash script to check if the current git branch = “x”

I am very bad at shell scripting (with bash), I am looking for a way to check if the current git branch is “x”, and abort the script if it is not “x”. #!/usr/bin/env bash CURRENT_BRANCH=”$(git branch)” if [[ “$CURRENT_BRANCH” -ne “master” ]]; then echo “Aborting script because you are not on the master branch.” […]

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