[Java] Java Core 79: Git Tutorial (2) Git Installation

Article Directory



insert image description here

We mentioned in the last article: Git is a distributed version control system, which is often used as a tool for collaborative development and version management. It can track file modifications, record historical versions, and support multi-person collaborative work. With Git, you can easily create and switch branches, merge code, roll back changes, and more.

The following are some commonly used commands and functions of Git:

git init: 在当前目录初始化一个新的Git仓库。
git clone [URL]: 克隆(下载)远程仓库到本地。
git status: 查看工作区和暂存区的状态。
git add [file]: 将文件添加到暂存区。
git commit -m "message": 提交暂存区的文件变更,创建一个新的版本。
git push: 将本地分支上的提交推送到远程仓库。
git pull: 从远程仓库拉取最新的代码到本地分支。
git branch: 查看分支列表。
git checkout [branch]: 切换到指定分支。
git merge [branch]: 将指定分支的代码合并到当前分支。
git log: 查看提交日志历史。
git diff: 查看文件的修改差异。
git stash: 暂存当前工作区的修改,方便切换分支或恢复之后再应用修改。

Target

GIT installation is complete and the test is successful

content

Download the relevant software into the picture below
insert image description here

The installation process is very simple, all kinds of next steps, all kinds of Next, just a little click and you're done


Double-click to install directly [the version is 64-bit system]

insert image description here

Click Next

insert image description here


Click Next

insert image description here

Click Next

insert image description here

Click Next

insert image description here

Click Next

insert image description here

The following steps are directly Next

insert image description here

Click Finish to complete the installation, verify the installation, find a blank space on the desktop, right click and the following window will appear

insert image description here

After clicking, the Git console appears, enter git in the console, and you can see related help information

insert image description here
As above, the interface is installed successfully!

Summarize

Select the corresponding installer to download according to your operating system. Git supports a variety of operating systems, including Windows, macOS, and Linux.

For Windows users, run the downloaded installer (such as Git-2.x.xx-x64.exe) after the download is complete, and then follow the instructions of the installation wizard to install. During installation, you can choose whether to add Git to your system's environment variables so that you can use Git commands from anywhere.

For macOS users, run the downloaded installer (eg git-2.x.xx-intel-universal-macosx.dmg) after the download is complete. After double-clicking to open the installation package, drag and drop the Git icon into the "Applications" folder to complete the installation.

For Linux users, choose the corresponding installation method according to the distribution you are using. You can refer to the official documentation or use a package manager such as apt, yum, etc. to install.

After the installation is complete, you can verify that the installation is successful by entering the git --version command in the command line terminal, and the current Git version number will be displayed.

After installation, you can manage the code base, perform version control, etc. by executing various Git commands in the command line or terminal.

Note: If you already have Git installed, make sure to update it to the latest version to get the latest features and security fixes. You can use Git's built-in command git update-git-for-windows (Windows environment) or update through the package manager (Linux and macOS environment).



insert image description here

Guess you like

Origin blog.csdn.net/m0_60915009/article/details/131457041
Recommended