top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

can we prevent reflog deletion when branch is deleted?

0 votes

Is there a way to prevent reflog deletion when the branch is deleted? The last entry could simply be a line where the second SHA is all 0's.

posted Jun 1, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

This is a known problem. The technical reason that this is not trivial to solve is the possibility of a directory/file conflict between old reflog files and references that might be created subsequently (which in
turn is a limitation of how loose references and reflogs are mapped to filenames):

git branch foo
git branch -d foo
git branch foo/bar

Under your proposal, the second line would retain the reflog file for foo, which is named ".git/logs/refs/heads/foo". But the third line wants to create a file ".git/logs/refs/heads/foo/bar". The existence of the "foo" file prevents the creation of a "foo" directory.

A similar problem exists if "foo" and "foo/bar" are exchanged in the above example.

Peff proposed a solution to this problem [1], but AFAIK it is not making progress.


answer Jun 1, 2013 by anonymous
Similar Questions
0 votes

$ git push origin :ABRANCHNAME
remote: Firing Pre - receive hook
remote: Firing Post receive hook
remote: Branch is ABRANCHNAME -- not creating Trigger file since this is not _int branch
remote: error: Trying to write ref refs/tags/ABRANCHNAME!SN-BL-20130605_100513_04363 with nonexistent object 0000000000000000000000000000000000000000
remote: fatal: refs/tags/ABRANCHNAME!SN-BL-20130605_100513_04363: cannot update the ref
To ssh://git@ourgitserver/repositoryname.git
- [deleted] ABRANCHNAME

I would not expect this behavior. Is git attempting to modify the tags associated to the HEAD commit on the branch in addition to the branch? If so, I would like to consider this a bug report...

+1 vote

I wanted to avoid push if any of the files is deleted from the local git clone area. Can anyone please help me with that?

I am using Stash for repository management.

0 votes

When I update my branch from master it pulls down several files, including some sass files. When I compile, however, gulp alerts me that I am missing .scss files.

I tested this by creating a new fresh branch and running gulp sass. This time there were no errors and I saw the missing .scss had been brought in.

Would anyone know why, on update, I am only getting some of the files from master?

+1 vote

A newbie question. Organization "Foo" has developers Sam, Fred, and Guido. The org clones Project X and over time realizes their own branch needs to be separate from the project for a while. Sam, Fred, and Guido each branch their code for the parts of the project they are working on.

When Foo decides X-Foo is ready to merge with the master, can the three developers merge their changes into Foo's branch, and then merge the corporate branch into the project? Assuming everyone is willing, of course.

+5 votes

basically, I've got clones of some expensive-to-build projects (node.js), and I have changes that I want to rebase/cherry-pick onto dev and stable branches.

I know I can push to a remote, then pull into my other, and keep the two on different branches so the builds don't get out of date. But, I think I'd like it if they all just shared the same objects, branches, etc...

Could I symlink together my .git{branches,config,hoks,logs,objects,packed-refs,refs} directories? Is this just going to kill me later?

Useful Links with Similar Problem
Contact Us
+91 9880187415
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.