Pull all commits from a branch, push specified commits to another

I have the following branches: master production and the following remote branches: origin/master origin/production I have a script that fetches the origin/master branch and gets the diff of what changed from my last fetch (log -p master..origin/master). Then I merge origin/master. The commits found are pushed to a code review tool. I want to push […]

What does 'adding to the index' really mean in Git?

I’ve got a question regarding Git basics. Basically, what does the action known as “add to the index” mean in Git? I understand it like this: If for any file git calculates SHA-1 sum then basically adding to index means that it calculates SHA-1 sum and add file to the staging area. Am I correct?

Unable to Authenticate with Git Bash to Visual Studio Team Services

I am unable to run any commands against my remote repository at Visual Studio Team Services (VSTS) because authentication fails. I am able to do Pulls etc through VS. But only through VS. Not through GIT bash, or any other tool like SourceTree.

How can I debug git/git-shell related problems?

How can I have some debug information regarding git/git-shell? I had a problem, that user1 could clone a repository without problem, while user2 could clone only an empty one. I had set GIT_TRACE=1, but nothing useful was told. Finally, after a long trial and error, it turned out that it was a permission problem on […]

(Mac) -bash: __git_ps1: command not found

I’m trying to change my command promt in terminal. I keep getting the error: -bash: __git_ps1: command not found I’ve tried it just by typing it into the terminal as is: __git_ps1. I’ve also tried it out in the .bash_profile if [ -f ~/.git-completion.bash ]; then source ~/.git-completion.bash export PS1='[\W]$(__git_ps1 “(%s)”): ‘ fi As you […]

Checking out old file WITH original create/modified timestamps

Is there any way to know or get the original create/modified timestamps? Thanks.

Is there a way to lock a branch in GIT

I have an idea of locking a repository from users pushing files into it by having a lock script in the GIT update hook since the push can only recognize the userid as arguments and not the branches. So i can lock the entire repo which is just locking a directory. Is there a way […]

Is there a way to configure git repository to reject 'git push –force'?

I was wondering is there a way to prevent ‘git push –force‘ on a repository (only on master branch)? Assume I have remote git repository and do: ‘git push‘ to ‘master’. It works. ‘git push –force‘ to ‘branch-1’. It works. ‘git push –force‘ to ‘master’. It is rejected. Is it even possible? Thanks for any […]

Git is changing my file's permissions when I push to server

I am using git to manage a website on a server. I have a local repository shown below local@workstation:myapp$ ls -l | awk ‘{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(“%0o “,k);print}’ total 16 755 drwxr-xr-x@ 18 thomas staff 612 Jun 13 15:35 application 755 drwxr-xr-x@ 11 thomas staff 374 Jun 12 16:25 assets 644 -rw-r–r–@ 1 thomas staff 6399 Jun 22 […]

The current branch is not configured for pull No value for key branch.master.merge found in configuration

I get this error when I try to pull from remote repository using Egit team>pull The current branch is not configured for pull No value for key branch.master.merge found in configuration

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