Tag: bash

set umask on remote server through fabric script

Me along with a team of developers use fabric to deploy code to remote server, Whenever a new file is created and added to the git repo the default permission will be -rw–r–r which makes it impossible for other developers to update this file (all users belong to same primary group). I want the permissions […]

bash show git branch as dirty all the time

I am using a bash script that I found online somewhere, and it is everywhere, to display current git branch. function parse_git_dirty { [[ $(git status 2> /dev/null | tail -n1) != “nothing to commit (working directory clean)” ]] && echo “*” } function parse_git_branch { git branch –no-color 2> /dev/null | sed -e ‘/^[^*]/d’ […]

GitHub – Pushed a change to master, but appears as different user than me?

I have a GitHub repo located here. I just commited a change to my repo and pushed to master branch, as I always do. I entered my account name and password, and the commit was pushed to GitHub. However, when I checked my GitHub commits page, I see a user that is not me. Did […]

How do I exclude files from git ls-files?

How do I list everything except markdown files? I have tried, as show in the code below, to run ls-files with the –exclude flag, but the excluded files are still shown in the output. My git version is 2.6.4 (Apple Git-63) $ git ls-files ChromeExt/read-coffee Node/README.md Node/web-scraping README.md $ git ls-files –exclude *.md ChromeExt/read-coffee Node/README.md […]

combine two bash commands into a one shortcut prompt

I’m not great with bash, but i’d like to write a shortcut, such as ‘opendev’, that opens a url in a browser and opens the current git topic branch i’m on. (only needs to work on os x). Inspiration here is from heroku CTL’s “heroku open”. I’ve got the basics here but i’m not sure […]

output files in git repository with bash

I tried to output files in a git repository with bash in the way: #!/bin/bash files=$(git ls-files -z) while IFS=” read -r -d ” file do echo “filename: $file” done < <(printf ‘%s’ “$files”) But it doesn’t provide any. Can you please help me to find the problem?

Why Does My BASH Script Fail When Adding Additional Arguments?

I have a BASH script to go through my Git projects recursively and pull them. We use two branches, master and development. When I change the script to include && git checkout development, my script fails to run and I get this error: find: missing argument to `-exec’ When I remove the && git checkout […]

Get the modified files

I want to have a list of modified files using a searching pattern so far, I have done that git log –pretty=oneline | grep SEARCH_TEXT | cut -d’ ‘ -f1 to get all the concern commit. I could now use xargs and git log –pretty=oneline –name-only to have all the files and then sort | […]

Get # of commits in current branch with bash script

How do I fix this script? var commits() { var $GITABRANCH = “git rev-parse –abbrev-ref HEAD” “git rev-list –count $GITABRANCH” } getting parse errors.

Bash script assistance with find

I’m trying to write a bash script called by a daily cron schedule that will cycle all sub directories looking for a .git directory, run a git pull –all on that repository to update the repo and grab any new branches, track those branches, and then move on to the next repo. I’m a bash […]

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