Tag: bash

get name of current branch to use for script

I have a done.sh script that I call whenever I am done working on a branch (after publishing the branch to remote repo, and merging it into dev). Currently it only contains the below: git checkout master && git pull I’d like to also include deletion of the current branch. I know that the shorthand […]

git bash ssh-keygen documentation

I have tried googling this, but I am having a hard time finding it. Where would I find official documentation for using the ssh-keygen command from a git bash from Windows? This is the bash that gets installed with msysgit. I want to know exactly what options it accepts and what they all mean. Thanks.

git hook bash does not work

working hard on configuration of my git repository, but stil no success. Goal: as soon i make a push on my lokal repo, to the dev branch, it will merged with master brench. post-update (hook) #!/bin/bash # # An example hook script to prepare a packed repository for use over # dumb transports. # # […]

Create remote repository from local files that are already on a local repo

I am aware of the clone function that could do this, but the thing it would clone what is in the repo, being everything that was pushed. What we need is to modify some files in our repository template and create a new repo with these modified files, without having to commit these files (that […]

Root can use Git, but any other account: -bash: git: command not found

.bashrc (on user account): export PATH=/usr/bin:$PATH How can I get Git to work on accounts other than Root?

PHP: shell_exec multiple commands

So I am attempting to create list of modified files between two git commands: shell_exec(” git diff –name-only $remoteCommitId $localCommitId > diff && SET /p DIFF=<diff && git archive –output=$zipName HEAD %DIFF% “); However, no zip file is created I also tried separating commands with & and ;. If a run these commands in batch […]

Git (on Windows using msysgit) – “compound” command

I need to do several “two-step” or “three-step” commands in Git quite frequently, that require me to also specify a branch name as a parameter – things like: git checkout (branch name) git pull origin (branch name) or stuff like that. I would like to “automate” this into an alias – but a simple Git […]

Going back to the history of my working directory – git, bash

I used git commit command directly on a remote repo, then git reseting hard to HEAD^,and I don’t know which files of the remote directory were deleted, is possible to find the history of the files of my remote working directory ? Perhaps a bash command would suffice ?

How to auto-configure git merge tool based on what is available on current machine?

I am working a many system and at least on some of them my home directory is stored on NIS, so I do share that same preferences. I do want to write a small bash script which I can include inside ~/.bash_profile which will configure the best diff tool which is already installed on current […]

On OSX, using tr to squeeze git diff results translates spaces to tabs

My issue is very simple to replicate, and I’ve only tested it on OSX with the default version of “tr” that comes bundled with 10.8.3. Whenever I do a: git diff –numstat <sha1> <sha2> it results in the following: 1 1 test.php Notice how the separating character between the ones are all spaces. Now, when […]

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