Git Product home page Git Product logo

Comments (2)

WangYihang avatar WangYihang commented on June 5, 2024

好主意!

from githacker.

WangYihang avatar WangYihang commented on June 5, 2024

Done, @shashade250 , thanks for your brilliant idea!

This feature will be released in v1.1.4.

Experiment Setup

$ mkdir repo
$ cd repo
$ git init
$ echo 'master' > README.md
$ git add --all
$ git commit -m "init commit in master branch"
$ git checkout -b private_branch
$ echo 'private_branch' >> README.md
$ git add --all
$ git commit -m "second commit in private branch"
$ git status
On branch private_branch
nothing to commit, working tree clean
$ python3 -m http.server

Test Results

Old version (v1.1.3)
$ githacker --version                        
1.1.3
$ githacker --url "http://127.0.0.1:8000/" --output-folder v1.1.3
2022-07-27 21:08:34 INFO 1 urls to be exploited
2022-07-27 21:08:34 INFO Exploiting http://127.0.0.1:8000/ into v1.1.3/17abf5259517d604cc9599a00b7385d6
2022-07-27 21:08:34 INFO Downloading basic files...
2022-07-27 21:08:34 INFO [73 bytes] 200 .git/description
2022-07-27 21:08:34 INFO [32 bytes] 200 .git/COMMIT_EDITMSG
...
2022-07-27 21:08:34 INFO [22 bytes] 200 .git/objects/1f/7391f92b6a3792204e07e99f71f643cc35e7e1
2022-07-27 21:08:34 INFO [22 bytes] 200 .git/objects/1f/7391f92b6a3792204e07e99f71f643cc35e7e1
2022-07-27 21:08:34 INFO Cloning downloaded repo from /tmp/tmpe8tp_0j9 to v1.1.3/17abf5259517d604cc9599a00b7385d6
2022-07-27 21:08:34 ERROR Cloning into 'v1.1.3/17abf5259517d604cc9599a00b7385d6'...
done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.
2022-07-27 21:08:34 INFO Check it out: v1.1.3/17abf5259517d604cc9599a00b7385d6
2022-07-27 21:08:34 INFO 1 / 1 were exploited successfully
2022-07-27 21:08:34 INFO http://127.0.0.1:8000/ -> v1.1.3/17abf5259517d604cc9599a00b7385d6
$ cd v1.1.3/17abf5259517d604cc9599a00b7385d6
$ git status
On branch master

No commits yet

nothing to commit (create/copy files and use "git add" to track)

As the above log goes, a warning appears. And the current repo branch is master, but private_branch is expected.

warning: remote HEAD refers to nonexistent ref, unable to checkout.
New version (v1.1.4)
$ githacker --version                        
1.1.4
$ githacker --url "http://127.0.0.1:8000/" --output-folder v1.1.4
2022-07-27 21:13:52 INFO 1 urls to be exploited
2022-07-27 21:13:52 INFO Exploiting http://127.0.0.1:8000/ into v1.1.4/17abf5259517d604cc9599a00b7385d6
2022-07-27 21:13:52 INFO Downloading basic files...
2022-07-27 21:13:52 INFO [73 bytes] 200 .git/description
2022-07-27 21:13:52 ERROR [469 bytes] 404 .git/FETCH_HEAD
...
2022-07-27 21:13:53 INFO [22 bytes] 200 .git/objects/1f/7391f92b6a3792204e07e99f71f643cc35e7e1
2022-07-27 21:13:53 INFO [22 bytes] 200 .git/objects/1f/7391f92b6a3792204e07e99f71f643cc35e7e1
2022-07-27 21:13:53 INFO Cloning downloaded repo from /tmp/tmppr2gv75n to v1.1.4/17abf5259517d604cc9599a00b7385d6
2022-07-27 21:13:53 ERROR Cloning into 'v1.1.4/17abf5259517d604cc9599a00b7385d6'...
done.
2022-07-27 21:13:53 INFO Check it out: v1.1.4/17abf5259517d604cc9599a00b7385d6
2022-07-27 21:13:53 INFO 1 / 1 were exploited successfully
2022-07-27 21:13:53 INFO http://127.0.0.1:8000/ -> v1.1.4/17abf5259517d604cc9599a00b7385d6
$ cd v1.1.4/17abf5259517d604cc9599a00b7385d6
$ git status
On branch private_branch
Your branch is up to date with 'origin/private_branch'.

nothing to commit, working tree clean

No warning, no errors. The current branch name is private_branch as expected.

from githacker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.