git常用命令整理

Posted fhwup

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git常用命令整理相关的知识,希望对你有一定的参考价值。

You have an empty repository

To get started you will need to run these commands in your terminal.

Configure Git for the first time

git config --global user.name "fhw"
git config --global user.email "[email protected]"

Working with your repository

I just want to clone this repository

If you want to simply clone this empty repository then run this command in your terminal.

git clone ssh://[email protected]/~fhw/demo.git

My code is ready to be pushed

If you already have code ready to be pushed to this repository then run this in your terminal.

cd existing-project
git init
git add --all 或者 git add .
git commit -m "Initial Commit"
git remote add origin ssh://[email protected]/~fhw/demo.git
git push origin master

My code is already tracked by Git

If your code is already tracked by Git then set this repository as your "origin" to push to.

cd existing-project
git remote set-url origin ssh://[email protected]/~fhw/demo.git
git push origin master

 

 

以上是关于git常用命令整理的主要内容,如果未能解决你的问题,请参考以下文章

常用python日期日志获取内容循环的代码片段

RHEL8-dnf命令测试

C#常用代码片段备忘

最全最详细publiccms常用的代码片段

最全最详细publiccms其他常用代码片段(内容站点)

Linux必会100个命令(五十八)dnf命令