How to change git ssh user for a remote push temporarily?

Is it possible to change the ssh user temporarly for a “git push remote master” without messing up with .git/config or “git remote”, or using the whole remote url? [root@host gitrepo]# git push otheruser@remote master # this does not work, but how great it would be [root@host gitrepo]# USER=otheruser git push remote master # still […]

How to unstash only certain files?

I stashed my changes. Now I want to unstash only some files from the stash. How can I do this?

How do we verify commit messages for a push?

Coming from CVS, we have a policy that commit messages should be tagged with a bug number (simple suffix “… [9999]”). A CVS script checks this during commits and rejects the commit if the message does not conform. The git hook commit-msg does this on the developer side but we find it helpful to have […]

Is it possible to pull just one file in Git?

I am working on a GIT branch that has some broken tests, and I would like to pull (merge changes, not just overwrite) these tests from another branch where they are already fixed. I know I can do git pull origin that_other_branch but this will attempt to merge lots of other files, for that I […]

git add, commit and push commands in one?

Is there any way to use these three commands in one? git add . git commit -a -m “commit” (do not need commit message either) git push Sometimes I’m changing only one letter, CSS padding or something. Still, I have to write all three commands to push the changes. There are many projects where I’m […]

git: undo all working dir changes including new files

How to delete all changes from working directory including new untracked files. I know that git checkout -f does that, but it doesn’t delete new untracked files created since last commit. Does anybody have an idea how to do that?

Delete local Git branches after deleting them on the remote repo

I want to have my local and remote repositories always in sync in terms of branches. After a Pull Request review on GitHub, I merge and remove my branch there (remote). How could I fetch this information in my local repository and get Git to remove my local version of the branch as well?

How to integrate a GitHub wiki into the main project

I want keep all my source code and documentation in one single git repository. I already have the github pages integrated into my main project and now I want to do the same with the github wiki. I know that github wikis are plain git repositories. My plan is to add the wiki as a […]

Git/gitosis: How to check validity of user name and email?

I have installed git and gitosis and I need to add a check that the user name is valid when something is pushed into the repository. I reckon the pre-receive hook is the correct hook to place this, but I’m unable to find the real user name and email address which gitosis enters into the […]

use git smudge/clean to replace file contents

I am attempting to use git to manage deployment to my live website. The problem that I’m having is that I have a couple of settings files that I don’t want to be updated when I push to production what I’m looking at doing is either using a hook or smudge/clean to change the file […]

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