pcottle/learnGitBranching là một trong những repo mã nguồn mở mà TopGit theo dõi, hiện có 34.2k sao, viết chủ yếu bằng JavaScript. An interactive git visualization and tutorial. Aspiring students of git can use this app to educate and challenge themselves towards mastery of git!
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
LearnGitBranching is a git repository visualizer, sandbox, and a series of educational tutorials and challenges. Its primary purpose is to help developers understand git through the power of visualization (something that's absent when working on the command line). This is achieved through a game with different levels to get acquainted with the different git commands.
You can input a variety of commands into LearnGitBranching (LGB) -- as commands are processed, the nearby commit tree will dynamically update to reflect the effects of each command:
This visualization combined with tutorials and "levels" can help both beginners and intermediate developers polish their version control skills. A quick demo is available here:
https://pcottle.github.io/learnGitBranching/?demo
Or, you can launch the application normally here:
https://pcottle.github.io/learnGitBranching/
Sandbox Mode
By default the application launches in "sandbox mode" with a basic repository already created. Here you can enter commands and mess around with a repository as much as you like. Keep in mind you can
undo to undo the effects of the last command
reset to start over with a clean slate (works in levels too)
git fakeCreateRemote to simulate creating a remote repository!
Sandbox mode can be great for demonstrating something to a friend, but the real learning is with levels...
Levels
Type levels to see the available lessons / challenges (and which ones you have solved so far). Each level series aims to teach some high-level git concept, and each tab of levels separates major worlds of info (like remote repositories versus local).
For some added fun, there is a "git golf" concept where we keep track of how many commands you use to solve each level. See if you can match all of our records!
Sharing permalinks
You can share a link to LearnGitBranching with an arbitrary set of commands that will execute upon load by using the command URL parameter. You will also likely want to disable the intro dialog for this case with the NODEMO url param; here is an example to get started.
Level Builder
You can build levels with the build level command. A dialog will walk you through the process, and at the end it will show you a JSON blob that represents the level you just created. Paste that in a gist or directly into an issue and I can check it out / merge in your changes! You can also share this level directly with friends by having them run import level and paste the JSON in the resulting text field, or simply send them a custom URL with the gist ID in the parameters, like so:
https://pcottle.github.io/learnGitBranching/?gist_level_id=a84407351f9c9f0cb241
Reporting Bugs / Opening Issues
When reporting bugs, try running the command debug_copyTree() in your JS console when in a state just before reproducing a bug. This can avoid having to copy all the commands you used to get into a specific state. (I can then use the importTreeNow command to get to that exact state)
Building yourself / Contributing Functionality
For contributing core functionality in the app, you'll probably want to test your changes
at least once before submitting a pull request. The app builds with Vite;
you'll need yarn to download all the dependencies of the project.
The general workflow / steps are below:
git clone <your fork of the repo>
cd learnGitBranching
yarn install
git switch -c newAwesomeFeature
vim ./src/js/git/index.js # some changes
yarn dev # dev server with live reload at http://localhost:5173
# or, for a production build:
yarn build # outputs index.html + hashed assets into ./build
open ./build/index.html
vim ./src/js/git/index.js # more changes
yarn test # runs the jasmine test suite
yarn lint # runs ESLint correctness checks
git commit -am "My new sweet feature!"
git push
# go online and request a pull
Alternatively, you can also build and run the app in a pre-configured online workspace:
Other Technical Details
LearnGitBranching is a pretty simple application (from a technical perspective). There's no backend database or any AJAX requests -- it's a 100% clientside application written in JavaScript. The production version (on github.io) literally just serves up an HTML page with some JS and CSS.
Here is the high-level process of the build:
index.html is the Vite entry point and contains the view templates
CSS and JavaScript are bundled and minified into ./build/assets
Static assets and generated level documentation are copied into ./build
Production builds run the tests before generating output
That's it!
Use yarn dev while developing, or run yarn build and serve the resulting
./build directory to inspect a production build.
Docker
You can run the most recently built stable image with docker run -p 8080:80 ghcr.io/pcottle/learngitbranching. Access your environment at http://localhost:8080/
You can build the app and image with the command: docker build -t ghcr.io/pcottle/learngitbranching:latest .. See the Makefile for information on how to build locally with docker.
Some of our amazing contributors
Helpful Folks
A big shoutout to these brave souls for extensively testing our sandbox and finding bugs and/or inconsistencies:
Nikita Kouevda
Maksim Ioffe
Dan Miller
And the following heroes for assisting in translating:
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/pcottle/learnGitBranching là nguồn chính thức.
pcottle/learnGitBranching có phải mã nguồn mở không?
Có — pcottle/learnGitBranching phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/pcottle/learnGitBranching.
pcottle/learnGitBranching là gì?
pcottle/learnGitBranching (pcottle/learnGitBranching) là dự án JavaScript trên GitHub. Theo mô tả gốc: An interactive git visualization and tutorial. Aspiring students of git can use this app to educate and challenge themselves towards mastery of git!
Đọc đầy đủ README ở tab phía trên.
learnGitBranching có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về learnGitBranching.