gitinit # 初始化一个本地版本库gitstatus # 查看当前工作区(workspace)的状态gitadd [FILES] # 把文件添加到暂存区(Index)gitcommit -m "wrote a commit log infro” # 把暂存区里的文件提交到仓库gitlog # 查看当前HEAD之前的提交记录,便于回到过去gitreset —hard HEAD^^/HEAD~100/commit-id/commit-id...
The git add command doesn't change the repository and the changes are not saved until we use git commit. git commit 提交修改到本地 git commit -m "<message>" 提交git仓库并注释有什么东西进行了修改 git commit --amend git push git push origin(远程仓库) dev(本地): dev(远程) 推送本地dev...
hint:Using'master'asthe nameforthe initial branch.Thisdefaultbranch namehint:is subject to change.To configure the initial branch name to useinallhint:ofyournewrepositories,which will suppressthiswarning,call:hint:hint:git config--global init.defaultBranch<name>hint:hint:Names commonly chosen instead...
1.获得一个仓库 当要使用git对项目进行管理的时候,使init面命令进行git的初始化,就会自动进行相关的初始化操作,会在项目中创建隐藏的.git文件夹,里面有相关的配置信息。 $ git init# 也可在初始化时指定默认分支的名称,否则默认一般为`master`$ git init -b main $ git init --initial-branch=main# 或者先...
init.defaultBranch Allows overriding the default branch name e.g. when initializing a new repository. init.defaultObjectFormat Allows overriding the default object format for new repositories. See--object-format=ingit-init[1]. Both the command line option and theGIT_DEFAULT_HASHenvironment variable...
p, pick = use commit# r, reword = use commit, but edit the commit message# e, edit = use commit, but stop for amending# s, squash = use commit, but meld into previous commit# f, fixup = like "squash", but discard this commit's log message# x, exec = run command (...
Git Manual GIT-INIT(1) NAME git-init - Create an empty git repository or reinitialize an existing one SYNOPSIS git init [-q | --quiet] [--bare] [--template=<template_directory>] [--separate-git-dir <git dir>] [--shared[=<permissions>]] [directory] DESCRIPTION This command creates...
mkdir myRepository cd myRepository git init [文件] # 方法一,本地建立一个仓库,会在文件下面生成.git文件 git clone 仓库的url # 方法二,远程克隆一个仓库 5. git的三个区域和文件状态 git的本地数据管理区区域分为三个区域: 工作区、工作目录,本地工作目录(Working Directory):.git所在的目录,自己电脑上...
git init[-q | --quiet] [--bare] [--template=<template-directory>] [--separate-git-dir <git-dir>] [--object-format=<format>] [-b <branch-name> | --initial-branch=<branch-name>] [--shared[=<permissions>]] [<directory>] ...
git init 接下来,向本地Git存储库添加一个远程存储库。要使用GitHub作为远程存储库,请在GitHub上创建一个新的存储库并复制其URL。 图片来自作者 然后,将URL添加到本地Git存储库中,名称为“origin”: git remote add origin <repository URL> 接下来,在Git存储库中进行阶段更改或添加新文件: ...