-
Create a folder .git:
git init
-
Include all files:
git add .
-
or include specific file
git add ./{your_file}
-
Verify the status
git status
-
Commit files
git commit -m "my first commit"
-
Redirect to Branch Main
git branch -M main
-
Link your local repository to your remote GitHub repository You can create and find your Git remote here:
git remote add origin git@github.com:{usergithub}/{project}.git
-
Upload your files to branch main
git push -u origin main
-
or upload the files to the branch you want
git push -u origin {branch}
-
Delete the commit while keeping the code.
git reset --soft + "commit"
-
Remove the staging-area while keeping the code.
git reset --mixt + "commit"
-
Remove a Commit
git reset --hard
-
Save what was deleted with the last version of the commit
git reset --hard + "commit"
✨ Ready.