We met a problem in git.(We use Atlassian Stash in our team)
A file named "one.py" was firstly changed at 2015/04/01.
Then some other developers pushed a lot of changes to server in the coming days.
Later in 2015/04/08, the "one.py" file was changed again and push to stash server.
Then some other developers pushed a lot of changes to server as usual.
And comes the problem, today (2015/04/09), I found that the "one.py" file was reverted to the revision which we pushed the changes in 2015/04/01. And when I checked the "one.py" file's change history, I can't get the change history in 2015/04/08. It lost.
What happened? Why we lost the commit history? Can you help me?
Thanks Steven
If the commit also shows up locally when you do a "git log" on the clone (and I can't see why it wouldn't), you should be able to retore the file file (to the working directory) by doing a "git checkout <commit> <file>"
Does the commit from 2015/04/08 show up on the Stash server "Commits" page at all?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Probably your other developers used 'force' push and rewrite the GIT history in Stash.
You can enable 'disable force push' hook in your Stash repository (http://blogs.atlassian.com/2013/03/stash-22-customize-workflow-git-hooks-api-merge-checks/);
More about -force push can be found at Git documentation at http://git-scm.com/docs/git-push.
Simply put, your developers should always keep their local repo up to date by 'git pull' first, merge the conflict if any, then do 'push' to Stash.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your answer. But I've already 'disable force push' hook in our Stash repository. So I confused why we met this problem. Devs can't force push changes to stash server. Thanks Steven
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.