Skip to content

Git Cores is a project that gathers tips and hacks about Git, GitHub, Git Bash and Git Desktop. Enjoy and enjoy this wave!

License

Notifications You must be signed in to change notification settings

jonypeixoto/GitCores

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Full-Stack GitHub README
GitCores

GitCores is a repository of the project involving Git, Git Bash, GitHub and Git Desktop that every programmer in the world should know on the internet.


Preview   •     Prerequisites   •     How to Use   •    Technologies   •    License   •    Author

ℹ️ Preview

App Screenshot


⚠️ Prerequisites

Follow the instructions in each folder in each README and if necessary check the official website for each documentation:

You should know about these technologies:



ℹ️ How to Use

Here, you will find the step by step to run this project

In this project, follow the commands:



This project aims to document my experiences with Git and make your life easier when using it. All the experiences I've acquired throughout my life as a programmer, computer engineer:


I divided this project into 3 parts:


  • THE ESSENTIAL GIT(LEVEL 1)
  • MOVING FORWARD WITH GIT(LEVEL 2)
  • TO INFINITY AND BEYOND WITH GIT(LEVEL 3)

Study sources:





THE ESSENTIAL GIT:



Prerequisites:


  • Install Git and run the program Git;
  • Install Xampp;

To avoid errors, we will do it in 3 simple steps to optimize your local repository connection with the online repository on GitHub:


  1. Start Git and go to your project folder directory:

cd FOLDERPATH


cd /d/Dev/cdftv/


  1. Launch VS Code from Git:

code .


NOTE: Git Bash does not accept the "CTRL + V" command when you are going to set your folder path. Then, use:


SHIFT + INSERT


The "cd" command (without the folders) will help you point to the directory of the folder you created.


  1. After entering VS Code, go to SOURCE CONTROL or CTRL + SHIFT + G and click "INITIALIZE REPOSITORY"

3.1) Go to Git Bash and configure the repository so that you can insert the local repository into the online repository:


git remote add origin git@github.com:yournicknameongithub/yourrepositoryname.git

git remote add origin git@github.com:jonypeixoto/GitCores.git

3.2) In the Source Control menu of your VS Code, press Commit and Push and Okay!


Check out your GitHub profile to confirm your VS Code changes.



OBSERVATIONS - COMMANDS OUTSIDE VS CODE ON GIT BASH OR POSSIBLE ERRORS:



  1. The command verifies that the Git installation was successful and lists the main commands of the tool:

git


  1. Put your name in the repository:

git config --global user.name "YOUR NAME HERE"


  1. Check if the username was created successfully:

git config --global user.name


Git Bash will return your username confirming your registered username


  1. To check the actions log in Git Bash, launch the command:

git status


  1. Do not forget to request that all hidden folders appear, if you are using Windows (so that you can see the .git folder created in your main folder.

More about showing hidden Windows folders - official Microsoft website


  1. To add your "index.php" (with quotes in the command below) to your repository, use:

git add "index.php"


  1. If your project has several files, use the command to add all your project files directly to the repository:

git add -A


NOTE:


  1. Regarding Windows, Linux and MacOS terminals, there are some MacOS commands that are not the same as Windows as well as Linux.

If you need to go back 1 directory from a folder:


CD ../



  1. The "clear" command (without the quotes) clears all code started from your prompt (or terminal that is currently being used)

You can also know in detail the modifications based on the latest changes in the terminal. The diff will be reset as soon as you commit to your main repository.


git diff



  1. How does a commit work?

Commit is a way to save it to your Git repository so it stays online and you can refer to it and show it to others if needed.


  1. To perform a commit, write (don't forget to do "git add -A" - without the quotes - to add all the files in your repository):

git commit -m YOUR NAME PROJECT


  1. To check all the commits in all your branches, in detail in your terminal, that you performed in the repository you are working on (it is worth mentioning that your "git status" command - without quotes - will be reset every time you make a commit to the branch - the main repository with the official files that are in place in your application):

git log


Branch is the workspace where you currently work your code, it is where your main project is located. There are 2 types of branches: master branch (the main branch) and the secondary branch.


  1. How to create a branch? Just enter the code:

git branch "BRANCHNAMEHERE"


  1. To check the branches you have already created or check the current branch, just enter:

git branch


  1. To create a branch and/or be automatically directed to this secondary branch, simply enter:

git checkout "BRANCHNAMEHERE"


OBSERVATION


  1. With each new branch created, you must add your files again to that branch with the following command (check the inserted files with - git status):

git add -A


  1. How to commit in other branches?

In the same way that you commit to the master branch with the command:


git commit -m YOUR NAME PROJECT


  1. How to connect GitHub to your Git?

18.1) Create (generate) your github key so you can connect to Git

To do this, just enter: github key on Google or your search engine and see it on the official GitHub documentation website


18.2) Go to settings in your GitHub profile, search for SSH and GPG keys and click on New SSH key (to insert your previously generated SSH key according to the instructions in the official GitHub documentation):


I used the command below, but it can happen to be changed. So, follow the official GitHub documentation above that will help you in the best way:


ssh-keygen -t ed25519 -C "YOUREMAILHERE"


19)To add all files, including new files that you added directly to MASTER:


19.1 - Step 1) git config --global alias.coa '!git add -A && git commit -m'


19.2 - Step 2) git coa "YOURCOMMITNAMEHERE"


19.3 - Step 3) You check up the commit on command: git log


19.4) In case your commit was wrong and you want to go back to a specific commit from git log. Use the command:


git reset --hard SPECIFICCODEOFTHECOMMIT


Previously you need to go in command: git log


Example: git reset --hard f9ae850d95dde3f90cd9b0b4721b648cde8b6cdf


19.5) Step 4) You will connect these local applications to the remote GitHub repository:


19.5.1 - Step 4.1) If you are in a repository, you need to restart the repository:


19.5.2 - Step 4.1.1) git remote rm origin


19.5.3 - Step 4.1.2) git remote -v


19.5.3.1 - Step 4.1.3) git remote add origin URLGITHUBOFTHEPROJECT


Example - to add the files to the online repository:


git remote add origin https://github.com/jonypeixoto/GitCores


19.6 - Step 4.1.4) To connect the local repository to the online repository:



19.7 - Step 4.1.5) To update your local repository from the online repository:



19.8 - Step 5) To update your online repository from the local repository:


19.8.1 - Step 5.1) Commit to local repository and...


git commit -m "YOURCOMMITNAME"

19.8.2 - Step 5.2)... and commit to the online repository


Depending on the name of your main repository on GitHub, it may be called MAIN (new account on GitHub) or MASTER if you renamed it.


git push origin master
OR git push origin main



  1. To facilitate the connection of the local repository with the online repository, you can use Visual Studio Code - VS Code

20.1) Log into your GitHub account within VS Code (in the lower right corner there is an avatar icon written Sign in).


20.2) Access the gear icon (in the lower left corner of your VS Code), look for the "settings" option and search for git:enabled in the search bar and check the option Git Enabled - Whether git is enabled.


20.3) Access the Source Control icon or press the shortcut CTRL + SHIFT + G - it's the VS Code control panel to connect Git to GitHub. Click on "Download Git" or "reload VS Code" and at that moment it will install Git on your machine synchronizing with VS Code.


  • MOVING FORWARD WITH GIT(in production)

  • TO INFINITY AND BEYOND WITH GIT(in production)




🚀 Technologies


You need to understand the mechanisms that trigger each tool below:






📝 License

This project is under the MIT license. See the LICENSE for more information.



🌟 Author

Jony Peixoto

Made with ♥ by Jony Peixoto 👋 Get in touch!


Jony Peixoto Official Website

LIVES:

YouTube: Jony Peixoto

About

Git Cores is a project that gathers tips and hacks about Git, GitHub, Git Bash and Git Desktop. Enjoy and enjoy this wave!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages