0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

git

Posted at
// 1.创建一个README.md文件,作为项目说明文件.可写可不写。
    echo "# lianxi-1" >> README.md
// 2.初始化Git本地仓库,创建.git文件夹,开启版本控制。
	git init
// 3.把文件添加到暂存区,准备提交。你可以添加所有文件(git add .)或指定某个。
    git add README.md  git add .
// 4.提交到本地仓库,生成一个版本快照(必须有提交后才能 push)。
	git commit -m "first commit"
// 5.将当前分支改名为main。如果你本来就是main分支,可省略;否则建议执行以符合GitHub默认分支。
	git branch -M main
// 6.添加远程仓库地址,起别名origin,后续所有push都用这个地址。
	git remote add origin <URL>
// 7.推送代码到GitHub仓库的main分支,并建立关联(以后可简写为git push)。
    git push -u origin main
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?