I made a mistake, and started making commits “to the last tag”, which lands my commits in “no branch“. They should have been applied at the head of an already existing branch. I have not pushed my changes yet. I’ve found a few other question for when commits are in the wrong branch, but now […]
The man page for git-config lists these options for push.default: nothing – do not push anything. matching – push all matching branches. All branches having the same name in both ends are considered to be matching. This is the default. upstream – push the current branch to its upstream branch. tracking – deprecated synonym for […]
Is there a way to determine when a Git branch was created? I have a branch in my repo and and I don’t remember creating it and thought maybe seeing the creation timestamp would jog my memory.
I just started using Git and I got really confused between different branches. Can anyone help me to figure out what the following branch types are? local branches local tracking branches remote branches remote tracking branches What is the difference between them? And how do they work with each other? A quick demo code will […]
My colleague and I are working on the same repository we’ve branched it into two branches each technically for different projects, but they have similarities so we’ll sometimes want to commit back to the *master from the branch. However, I have the branch, how can my colleague pull that branch specifically. A git clone of […]
Every now and then I’m asked, on what commit a certain branch on git starts or if a certain commit has been created on a specific branch. The end point of a branch is pretty clear: that’s where the branch label sits. But – where did it start? The trivial answer would be: on that […]
We are using a git repository to store our project. We have our branches departing from the original branch. But now we want to create a small new project to track some documentation. For that we would want to create a new empty branch to start storing our files, and I would want other users […]
To move the branch pointer of a checked out branch, one can use the git reset –hard command. But how to move the branch pointer of a not-checked out branch to point at a different commit (keeping all other stuff like tracked remote branch)?
Is there a simple way to delete all local branches which do not have a remote equivalent? Example: Branches (local and remote) master origin/master origin/bug-fix-a origin/bug-fix-b origin/bug-fix-c Locally, I only have a master branch. Now I need to work on bug-fix-a, so I check it out, work on it, and push changes to the remote. […]
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 […]