You are on page 1of 1

Git global setup

git config --global user.name "Alirio Mambo"


git config --global user.email "aliriomambo@gmail.com"

Create a new repository

git clone https://gitlab.com/aliriomambo/teeste.git


cd teeste
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

Existing folder

cd existing_folder
git init
git remote add origin https://gitlab.com/aliriomambo/teeste.git
git add .
git commit -m "Initial commit"
git push -u origin master

Existing Git repository

cd existing_repo
git remote add origin https://gitlab.com/aliriomambo/teeste.git
git push -u origin --all
git push -u origin --tags

Revert Git repository

# Resets index to former commit; replace '56e05fced' with your commit code
git reset 56e05fced

# Moves pointer back to previous HEAD


git reset --soft HEAD@{1}

git commit -m "Revert to 56e05fced"

# Updates working copy to reflect the new commit


git reset --hard
git push

You might also like