 Pro Git 2nd Edition 2.1.413Config git config git config core.editor commands git help Getting and Creating Projects git init git clone Basic Snapshotting git add git status git diff git difftool git commit git reset repository with git init. From Git version 2.28 onwards, you can set a different name for the initial branch. To set main as the default branch name do: $ git config --global init.defaultBranch main macOS: $ cd /Users/user/my_project for Windows: $ cd C:/Users/user/my_project and type: $ git init This creates a new subdirectory named .git that contains all of your necessary repository files0 码力 | 731 页 | 21.49 MB | 1 年前3 Pro Git 2nd Edition 2.1.413Config git config git config core.editor commands git help Getting and Creating Projects git init git clone Basic Snapshotting git add git status git diff git difftool git commit git reset repository with git init. From Git version 2.28 onwards, you can set a different name for the initial branch. To set main as the default branch name do: $ git config --global init.defaultBranch main macOS: $ cd /Users/user/my_project for Windows: $ cd C:/Users/user/my_project and type: $ git init This creates a new subdirectory named .git that contains all of your necessary repository files0 码力 | 731 页 | 21.49 MB | 1 年前3
 Pro Git 2nd Edition 2.1.413repository with git init. From Git version 2.28 onwards, you can set a different name for the initial branch. To set main as the default branch name do: $ git config --global init.defaultBranch main macOS: $ cd /Users/user/my_project for Windows: $ cd C:/Users/user/my_project and type: $ git init This creates a new subdirectory named .git that contains all of your necessary repository files — git add is what will be in the subsequent historical snapshot. You may recall that when you ran git init earlier, you then ran git add Pro Git 2nd Edition 2.1.413repository with git init. From Git version 2.28 onwards, you can set a different name for the initial branch. To set main as the default branch name do: $ git config --global init.defaultBranch main macOS: $ cd /Users/user/my_project for Windows: $ cd C:/Users/user/my_project and type: $ git init This creates a new subdirectory named .git that contains all of your necessary repository files — git add is what will be in the subsequent historical snapshot. You may recall that when you ran git init earlier, you then ran git add- — that was to begin tracking files in your directory. The git 0 码力 | 501 页 | 17.96 MB | 1 年前3
 Pro Git 2nd Edition 2.1.413 Config git config git config core.editor commands git help Getting and Creating Projects git init git clone Basic Snapshotting git add git status git diff git difftool git commit git reset repository with git init. From Git version 2.28 onwards, you can set a different name for the initial branch. To set main as the default branch name do: $ git config --global init.defaultBranch main macOS: $ cd /Users/user/my_project for Windows: $ cd C:/Users/user/my_project and type: $ git init This creates a new subdirectory named .git that contains all of your necessary repository files0 码力 | 691 页 | 13.35 MB | 1 年前3 Pro Git 2nd Edition 2.1.413 Config git config git config core.editor commands git help Getting and Creating Projects git init git clone Basic Snapshotting git add git status git diff git difftool git commit git reset repository with git init. From Git version 2.28 onwards, you can set a different name for the initial branch. To set main as the default branch name do: $ git config --global init.defaultBranch main macOS: $ cd /Users/user/my_project for Windows: $ cd C:/Users/user/my_project and type: $ git init This creates a new subdirectory named .git that contains all of your necessary repository files0 码力 | 691 页 | 13.35 MB | 1 年前3
 Pro Git 中文版 第2版 2.1.66/home/user/my_project 在 macOS 上: $ cd /Users/user/my_project 在 Windows 上: $ cd /c/user/my_project 之后执行: $ git init 该命令将创建一个名为 .git 的子目录,这个子目录含有你初始化的 Git 仓库中所有的必须文件,这些文件是 Git 仓库的骨干。 但是,在这个时候,我们仅仅是做了一个初始化的操作,你的项目里的文件还没有被跟踪。 Changes to be committed 这行下面的,就说明是已暂存状态。 如果此时提交,那么该文件在你运 行 git add 时的版本将被留存在后续的历史记录中。 你可能会想起之前我们使用 git init 后就运行了 git add Pro Git 中文版 第2版 2.1.66/home/user/my_project 在 macOS 上: $ cd /Users/user/my_project 在 Windows 上: $ cd /c/user/my_project 之后执行: $ git init 该命令将创建一个名为 .git 的子目录,这个子目录含有你初始化的 Git 仓库中所有的必须文件,这些文件是 Git 仓库的骨干。 但是,在这个时候,我们仅仅是做了一个初始化的操作,你的项目里的文件还没有被跟踪。 Changes to be committed 这行下面的,就说明是已暂存状态。 如果此时提交,那么该文件在你运 行 git add 时的版本将被留存在后续的历史记录中。 你可能会想起之前我们使用 git init 后就运行了 git add- 命令,开始跟踪当前目录下的文件。 git add 命令使用文件或目录的路径作为参数;如果参 数是目录的路径,该命令将递归地跟踪该目录下的所有文件。 master 分支会在每次提交时自动向前移动。  Git 的 master 分支并不是一个特殊分支。 它就跟其它分支完全没有区别。 之所以几乎每一 个仓库都有 master 分支,是因为 git init 命令默认创建它,并且大多数人都懒得去改动 它。 66 图表 11. 分支及其提交历史 分支创建 Git 是怎么创建新分支的呢? 很简单,它只是为你创建了一个可以移动的新的指针。 比如,创建一个 0 码力 | 501 页 | 19.30 MB | 1 年前3
 Pro Git 中文版 第2版 2.1.66Further Reading 附录 C: Git 命令 设置与配置 git config git config core.editor 命令 git help 获取与创建项目 git init git clone 快照基础 git add git status git diff git difftool git commit git reset git rm git /home/user/my_project 在 macOS 上: $ cd /Users/user/my_project 在 Windows 上: $ cd /c/user/my_project 之后执行: $ git init 该命令将创建一个名为 .git 的子目录,这个子目录含有你初始化的 Git 仓库 中所有的必须文件,这些文件是 Git 仓库的骨干。 但是,在这个时候,我们仅 仅是做了一个初始化的操作,你的项目里的文件还没有被跟踪。 to be committed 这行下面的,就说明是已暂存状态。 如果 此时提交,那么该文件在你运行 git add 时的版本将被留存在后续的历史记录 中。 你可能会想起之前我们使用 git init 后就运行了 git add Pro Git 中文版 第2版 2.1.66Further Reading 附录 C: Git 命令 设置与配置 git config git config core.editor 命令 git help 获取与创建项目 git init git clone 快照基础 git add git status git diff git difftool git commit git reset git rm git /home/user/my_project 在 macOS 上: $ cd /Users/user/my_project 在 Windows 上: $ cd /c/user/my_project 之后执行: $ git init 该命令将创建一个名为 .git 的子目录,这个子目录含有你初始化的 Git 仓库 中所有的必须文件,这些文件是 Git 仓库的骨干。 但是,在这个时候,我们仅 仅是做了一个初始化的操作,你的项目里的文件还没有被跟踪。 to be committed 这行下面的,就说明是已暂存状态。 如果 此时提交,那么该文件在你运行 git add 时的版本将被留存在后续的历史记录 中。 你可能会想起之前我们使用 git init 后就运行了 git add- 命 令,开始跟踪当前目录下的文件。 git add 命令使用文件或目录的路径作为参 数;如果参数是目录的路径,该命令将递归地跟踪该目录下的所有文件。 0 码力 | 670 页 | 13.59 MB | 1 年前3
 git 操作手册针 对 单 一 项 目 的 设 置 , 使 用 --local 参 数 , 本 地 设 置 信 息 保 存 在 项 目 目 录/.git/config文件里 # cd 项目目录 # git init #初始化仓库,将在当前路径下生成.git子目录,子目录里有 此git仓库的相关信息 # git config --local user.name cof 推送本地和远程都存在的同名分支 ★仓库操作 # mkdir ~/testgit #创建项目目录 # cd ~/testgit # git init #初始化仓库,将在当前路径下生成.git子目录,子目录里 有此git仓库的相关信息,初始化后要设置当前工作的用户名等相关信息,否则 使用全局设置 --no-merged #查看没有合并到当前分支的分支列表 # git config --global init.defaultBranch main #设置默认分支名为main,默认 为master;设置完成后,再init其他仓库,则默认名称生效(只对新创建仓库生 效) # git branch -m main0 码力 | 35 页 | 1.69 MB | 1 年前3 git 操作手册针 对 单 一 项 目 的 设 置 , 使 用 --local 参 数 , 本 地 设 置 信 息 保 存 在 项 目 目 录/.git/config文件里 # cd 项目目录 # git init #初始化仓库,将在当前路径下生成.git子目录,子目录里有 此git仓库的相关信息 # git config --local user.name cof 推送本地和远程都存在的同名分支 ★仓库操作 # mkdir ~/testgit #创建项目目录 # cd ~/testgit # git init #初始化仓库,将在当前路径下生成.git子目录,子目录里 有此git仓库的相关信息,初始化后要设置当前工作的用户名等相关信息,否则 使用全局设置 --no-merged #查看没有合并到当前分支的分支列表 # git config --global init.defaultBranch main #设置默认分支名为main,默认 为master;设置完成后,再init其他仓库,则默认名称生效(只对新创建仓库生 效) # git branch -m main0 码力 | 35 页 | 1.69 MB | 1 年前3
 Gitea v1.21.1 中文文档enable gitea 禁用旧的 gogs 启动脚本: sudo systemctl disable gogs 对于使用 SysVinit 的发行版: 将更新后的脚本复制到 /etc/init.d/gitea 使用以下命令将服务添加到启动项: sudo rc-update add gitea 禁用旧的 gogs 启动脚本: sudo rc-update del gogs 您应该实现一个 Downloader ,用于获取存储库信息。 您应该实现一个 DownloaderFactory ,用于检测URL是否匹配,并创建上述的 Downloader 。 您需要在 init() 中通过 RegisterDownloaderFactory 注册 DownloaderFactory 。 您可以在downloader.go中找到这些接口。 目前,只实现了 GiteaLocalUploader0 码力 | 303 页 | 3.88 MB | 1 年前3 Gitea v1.21.1 中文文档enable gitea 禁用旧的 gogs 启动脚本: sudo systemctl disable gogs 对于使用 SysVinit 的发行版: 将更新后的脚本复制到 /etc/init.d/gitea 使用以下命令将服务添加到启动项: sudo rc-update add gitea 禁用旧的 gogs 启动脚本: sudo rc-update del gogs 您应该实现一个 Downloader ,用于获取存储库信息。 您应该实现一个 DownloaderFactory ,用于检测URL是否匹配,并创建上述的 Downloader 。 您需要在 init() 中通过 RegisterDownloaderFactory 注册 DownloaderFactory 。 您可以在downloader.go中找到这些接口。 目前,只实现了 GiteaLocalUploader0 码力 | 303 页 | 3.88 MB | 1 年前3
共 7 条
- 1














 
 