git add –patch with difftool

Is it possible to configure Git to use my configured difftool with git add –patch? I would like to pick the changes to add to the index via my own difftool.

get current branch name for use in git command

I sometimes want to use the current branch name to use in git commands. For example git push origin feature/really-long-branch-name Is there a git command that will give just the branch name so I can do something like the following? git push origin current_branch There is git rev-parse –abbrev-ref HEAD but that’s exactly useful in […]

git: obtain the benefits of `git rebase –interactive` for cherry picks

I’d like to be able to do this: git cherry-pick –interactive hash-0..hash-n-1 # fantasy command and obtain the same workflow as interactive rebase: an editor buffer comes up, containing: pick hash-0 pick hash-1 pick hash-2 … pick hash-n-1 where I can delete any unwanted commits, squash them together, or edit to pause between the picks […]

“git add” command is returning “fatal: outside repository” error message

I’m just entering into the wonderful world of git. I have to submit a bunch of changes that I’ve made on my program, located in a directory called: /var/www/myapp I’ve created a new directory “/home/mylogin/gitclone”. From this directory, I did a “git clone” command against the public repo and I was able to get the […]

Git make remote master point to another branch

We got a ‘dev’ branch thats been functioning as de-facto master for quite a while. Is there a way to make my remote/master just point to the same place as remote/dev ? (no merging / rebasing / extra work). (More or less a rename of dev to master) Thanks in advance

Cannot push to git repository

I keep getting this error message from git while pushing, even I am trying it after pulling over and over again: ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to ‘[repo url]’ To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. ‘git pull’) before pushing […]

git checkout throws an error on –assume-unchanged files

After I run git update-index –assume-unchanged path/to/file on a particular branch, I’m unable to switch branches using git checkout. It throws the following error: error: Your local changes to the following files would be overwritten by checkout: path/to/file Please, commit your changes or stash them before you can switch branches. Aborting But both git diff […]

How to push the “develop” branch to the remote “origin”?

When I do git flow init it creates a master and develop branches. When I add the remote I do git remote add origin git@github.com:NewB/our-repo.git. Now I have git flow initialized on my local repo and I have the remote repo added. After I do git push -u origin master I have master in my […]

count line changes with git?

Is there a simple way I can ask git for the amount of lines I added (or add and removed) in a specific date range? I’m using git on Windows, Linux and TortoiseGit(Windows)

.gitignore: How do I ignore nested directories?

I have the following directory structure: test/a test/b/c test/a/b/Ouput test/c/d/e/Output test/f/Output I want to ignore all the “Output” directories under “test”. I tried test/**/Output, but it didn’t work. What am I doing wrong?

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