git 常用命令
-
git init
init local repository -
echo "#your_repository_name" > README.MD
write "#your_repository_name" into README.MD , create README.MD at the same time -
git add README.MD
add README.MD to a local repository -
git add .
add all files to a local repository -
git commit -m "a commit message"
make a commit message to describe your modification, and commit the change you made.
after (5), you can create remote repo in github/gitee , in order to get a
-
git remote add main <url>
link the local repo to remote repo, theshould replaced by http links -
git push -u origin master
push and merge your local repo to remote repo -
git commit --amend
if you change the code after commit, but do not want make any further commits for just few changes, use this command to update the commit