Tag: bash

How to display git branch in PS1 with other output?

I got to display just the branch name in the PS1 if I am in a git repo linux PS1 – display branch name only inside a git repo, but I am not able to get it integrated with my earlier PS1, which is PS1=”[\D{%F} \@] \u /\W $ ” this displays, datetime + username […]

Why my MsysGit bash can not use winmerge as difftool

I tried to use winmerge as a difftool, but my git bash just can not use it. I tried to use follow cmds. git config –replace –global diff.tool winmerge git config –replace –global difftool.winmerge.cmd “winmerge.sh \”$LOCAL\” \”$REMOTE\”” git config –replace –global difftool.prompt false and tried to write .gitconfig file directly. And I download the Git2.5 […]

How to sync GIT and MySQL for application backup?

How can I keep a application (Yii2/PHP) with a database (MySQL) in sync when restoring a backup? The application is versioned and tagged with GIT and the database is backuped using mysqldump every night. The Adminstrator should be able to restore any database backup made (using either a script or a button in the application). […]

ssh – 'connection reset by peer' – windows

I am running ssh via git bash in a windows environment. I had everything working fine but now (a few days later) when I try to connect to bitbucket I get the message: ssh-exchange_identification: read: connection reset by peer. The full log looks like this: $ ssh -Tvvv -p 443 git@altssh.bitbucket.org OpenSSH_6.6.1, OpenSSL 1.0.1i 6 […]

How can I get a literal single quote in a git alias (that's a bash function)?

I’m working on a code-base that has a number of different git repos. So, I’m playing with submodules to try and organize all of them into one source repo. It looks something like this: source |- ember |- rails I’m now trying to make a git alias to checkout the same branch-name in all of […]

Difference between Contents of two SVN Branches

I want to compare two svn branches http://…/Br1 and http://…/Br2 such that script refers to a text file for names of files to check in Branches and shows a result that only gives missing file names in Br1 or Br2. I came across svn diff but it is not helping. Then I came across these […]

How can I change the docker id and name

I’m using jenkins to build docker containers and send the completed image to AWS S3 bucket. I’m trying to get a file that is pulled from Github onto the docker image and then package it up into a docker image. Currently I have jenkins completing the git pull and building the container but I can […]

How to checkout two working copy from two different branches each time I push to one of those branches?

I have two branches for an application, those two branches use two different config file for our application. in the remote server I was using GIT_WORK_TREE=”/home/webui/projects/startmeup-ui” git checkout -f that worked perfectly, then I modified it so that depending of what branch I’m pushing to it will checkout a copy to a different directory. #!/bin/bash […]

Git with Bash : exporting a subdirectory without getting the parent folder

I have a little personal website. To learn new things, I’m using git for my website and I would like to create a bash script which will do these steps : Identify the last tag version Checkout this version to a release specific folder (so my current work is not erased) Minify the css file […]

git pull into bash script

I try run bush script with git pull but have Permission denied. Run: sudo bash ./script.sh Script: echo -n “Would you like to do ‘git pull’ (\”y\” or \”n\”, default: \”n\”): ” read answer if [ “$answer” = “y” ]; then if ! git pull origin master; then echo “Pull conflicts!” exit fi fi And […]

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