I want to check the behavior of the code on GitHub and compare the code quickly.

Asked 1 years ago, Updated 1 years ago, 114 views

I'm a beginner.
"I would like to ""check the behavior I want and differentiate what is different from my code"" in the code on GitHub."
Is there a quick and speedy way to execute & compare?

◆ Flow

·git clone (create a folder with GitHub ID locally)
·Starting the server (I want to start multiple simultaneous, so I automatically assign ports)
·(View in browser ← Maybe I should do this manually)
·Check operation (whether the code is doing the desired behavior)
·Compare your code with diff tool

It is shaped like this.
I would appreciate it if you could give me some advice.

github

2022-09-30 21:47

2 Answers

  • Same directory structure and filename
  • Comparing the difference between your repository and checking out other people's sources

If so, you can achieve your goal by registering someone else's repository as a remote repository.

For example, register the repository https://github.com/yukihane/a-project.git on the GitHub of a person named yukihane under the name yukihane-repo

 git remote add yukihane-repo https://github.com/yukihane/a-project.git

and import

 git fetch --all

For example,

 git diff yukihane-repo/master

You can see the difference from the code of yukihane in .

 git checkout yukihane-repo/master

allows you to check out the source of yukihane (so you can verify its operation).
After that, if you want to change it back to your code, you can use the command

 git checkout master

will be


2022-09-30 21:47

I want to diff what is different from my code

For this purpose,
I often use git difftool in conjunction with WinMerge.


in the C:\Users [username].gitconfig file or to the C:\ProgramData\git\config file

 [diff]
    tool=winmerge
[difftool "winmerge" ]
    path='C:/Program Files/WinMerge/WinMergeU.exe'
    cmd = 'C:/Program Files/WinMerge/WinMergeU.exe'-r-u\"$LOCAL\"\"$REMOTE\"

Configuring the

 git difftool-d [commit] [commit]

Then you can see the difference between commits in multiple file directories.

Also

 gitk [commit] ... [commit] 

The command provides a graphical view of your changes, which is useful for tracking your changes.


2022-09-30 21:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.