How to do equivalent of "git-reset --hard" and "git revert HEAD" using jgit?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I need some guidance on how use jgit to implement the following methods:


    /**
* Rolls back all uncommitted changes so Index and worspace are rolled to committed state in HEAD version.
     * Functionally equivalent to "git reset --hard HEAD"
     *
     */
    public void rollback() {
    }

    /**
     * Undoes the last commit.
     * Functionally equivalent to "git revert HEAD"
     *
     * @param versionNameToRevertTo Version of Commit to revert to
     */
    public void revert(String versionNameToRevertTo) {
    }

It seems that I will have to walk the Tree and check status of each file to decide what to do with it. The TreeWalk api is not obvious from the javadoc.


TIA for any guidance you can provide.

--
Regards,
Farrukh Najmi

Web: http://www.wellfleetsoftware.com



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux