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
25 views

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.

[1] http://thread.gmane.org/gmane.comp.version-control.git/201715/focus=201752

answer Jun 1, 2013 by anonymous
Similar Questions
0 votes

$ git push origin :ABRANCHNAME
remote: Firing Pre - receive hook
remote:
remote:
remote: Firing Post receive hook
remote:
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...

0 votes

with git I noticed when I removed a remote branch with git push origin --delete in my clone when I used git branch -a I don't the deleted branch but my colleagues still see it.

I tried with two clones in my PC, with the first one delete branch and the other still sees it despite git pull .

I use git version 2.9.4

+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.


Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...