I read about some interesting git commands that I don't know.
For testing I like to use a local 'remote' repository
create a directory 'remote-repo'
navigate on the command line in this directory
initialize the repository git init
create a master branch git checkout -b master
to use it as 'remote' repo, open the file '.git/config' and append the follow lines
[receive]
denyCurrentBranch = ignore
Otherwise, you get an error when you try to push something in the repo
create a directory 'local-repo'
navigate on the command line in this directory
initialize the repository git init
create a file 'text1.txt'
add the file to the stage git add --all
commit the changes git commit -m "[ADD] test1.txt"
add the remote repository git remote add origin ../remote-repo/.git
push the commit in the remote repository git push --set-upstream origin master
git reset --hard
reset local changes, but not remove untracked files.
git clean -fd
remove all untracked files. It not removes ignored files.
touch test2.txt
git add --all
git commit --amend -m "new message"
git push --force
to push the changes in the remote repo, because you changed the history