Skip to content

vitorstabile/git-basics

Repository files navigation

Basic Tutorials of Git

Content

  1. Project Status
  2. About the Project
  3. Project Description
  4. Chapter 1: Basic Useful Commands
  5. Usage
  6. Contributors
  7. Contributing
  8. Roadmap
  9. To Do
  10. Contacts
  11. License

Project Status

Project Status: Under Development ⚠️

About the Project

This project have a propose to introduce the reader to basic concepts and commands in Git.

Project

Project Description

This is a simple basic tutorial about Git and your basic commands. Remenber, this project is under development.

Chapter 1: Basic Useful Commands

Chapter 1 - Part 1: Create a Project

  1. Make a "git bash here" in the main folder of the project
  2. Verify if your user is list in this terminal:
git config --list
  1. If you don't have a user in your git terminal, make this command:
git config --global user.name "Your name"
git config --global user.email "name@gmail.com"
  1. Now, to transfer your files to your repo in GitHub, make the commands:
git init
git status
git add .
git status
git commit -m "Project Created"
git remote add origin https://github.com/vitorstabile/git-basics.git
  1. If your git is in (master) try this command:
git push -u origin master
  1. To change to the new format, make this command to change the origin (master) to (main):
git branch -M main
  1. Now, push your project to GitHub:
git push -u origin main

Chapter 1 - Part 2: Make a Commit

  1. After you change anything in your project, make a git status:
git status
  1. The red files is the files that is not sincronizer with your github

  2. Add the files to stage

git add .
  1. Now, the files in green is in the stage
git status
  1. Now, make a commit:
git commit -m "another commit"
git push
  1. If your origin is in (main) not master, use the command below:
git push origin main

Chapter 1 - Part 3: Clone a Project

  1. Make a "git bash here" in the main folder of the project

  2. Verify if your user is list in this terminal:

git config --list
  1. If you don't have a user in your git terminal, make this command:
git config --global user.name "Your name"
git config --global user.email "name@gmail.com"
  1. Now, copy the adress of the project " Ex: https://github.com/vitorstabile/git-basics.git"

  2. Make this command with the copied adress:

git clone https://github.com/vitorstabile/git-basics.git
  1. Now, change the folder to master
cd git-basics
  1. To show all commits:
git log --oneline

Chapter 1 - Part 4: Generate a new SSH Key

  1. Open Git Bash.

  2. Paste the text below, replacing the email used in the example with your GitHub email address.

ssh-keygen -t ed25519 -C "your_email@example.com"

This creates a new SSH key, using the provided email as a label.

When you're prompted to "Enter a file in which to save the key", you can press Enter to accept the default file location. Please note that if you created SSH keys previously, ssh-keygen may ask you to rewrite another key, in which case we recommend creating a custom-named SSH key. To do so, type the default file location and replace id_ALGORITHM with your custom key name.

Enter a file in which to save the key (/c/Users/YOU/.ssh/id_ALGORITHM):[Press enter]
  1. At the prompt, type a secure passphrase.
> Enter passphrase (empty for no passphrase): [Type a passphrase]
> Enter same passphrase again: [Type passphrase again]
  1. To pring the correct way your SSH Key, make the command in Windows Machine
ssh-agent sh -c 'ssh-add; ssh-add -L'

in Linux Machine

cat ~/.ssh/id_rsa.pub

This will print something like this

ssh-ed25519 BBB3Hfncklediiwwjdfker your_email@example.com
  1. Copy the generated key and go in Setting than in SSH and GPG Keys


Settings - (Work by Vitor Garcia)


Add SSH Keys - (Work by Vitor Garcia)

  1. Add your SSH Key


Add SSH Keys - (Work by Vitor Garcia)

Usage

Using this like a bibliography if you want to remember any command with Git. For more commands, use this Notes.

Contributors


Vitor Garcia

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Roadmap

See the Issues for a list of proposed features (and known issues).

To Do

If so, list tasks / features that still need to be implemented in your application

📝 To Do 1

  • Implement the basics concepts of Git.

Contacts

Vitor Garcia
LinkedIn
Portfolio
GitHub

License

  • MIT License

  • Distributed under the MIT License. See LICENSE for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages