Code2night
  • Home
  • Blogs
  • Tutorial
  • Post Blog
  • Tools
    • Json Beautifier
    • Html Beautifier
  • Members
    • Register
    • Login
  1. Home
  2. Blogpost
21 Jul
2022

Git Tutorial for Beginners and Intermediate

by Shubham Batra

123

GitHub

GitHub is a platform for hosting your code for version control and collaboration with other people. It lets you and others work together on projects from anywhere. This tutorial teaches you basics of  GitHub like repositories, commits ,branches and creating pull requests. So , the first step is to create a github account

Step 1: Go to https://Github.com Then Create a GitHub account or log in with your credentials

You can simply create your github account as that is free for basic use and provides limited number of repositories without any cost. So , we will create our account and then will login from that.

Step 2: Create a new repository

Now since we have already done login, the first step for adding your project to github is to create a new repository. A repository is like a container that stores your project. You can choose any name for your repository. You can check the steps in below screenshots



Now since you have created repositories , you will get these command as help by github. These commands are which we will use to push or commit our code to repository.

git init
git add *
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/shubhambtra/ImageCompression.git
git push -u origin master
Now you have to go to file explorer to your project which you want to push on repository. Open the location of the project and open command prompt.

git init: We use the git init command to initialize a Git repository in the root of a folder

git init is the first command that we will use to intialize git on your  project location. Enter the command in the command prompt and press Enter

git init


git add * : git add command adds a change in the working directory to the staging area . This will add all the files to the queue of files that will be commited in next commit. So whenever we are trying to push new project to repository we have to perform git add *.

 git add *


git commit: This command is used to commit the changes added by the previous command. Now you have to remember it will just commit the changes locally and the changes still will not reach to repository.  You can give any name after git commit -m 'enter any thing' .Now we are ready Now we will use the git commit command as shown below:

git commit -m "first commit"

git remote add origin https://github.com/shubhambtra/ImageCompression.git

git push: this command is used to commited changes to push the changes from local commit to git repository. This will add up your changes to repository. Here master in the end stand for master branch . Which is also the main branch which comes by deault. In big project we have to keep only finalized changes in this branch.

To push an existing repository to a remote repository

git push -u origin master

Now, since you have pushed your changes to repository. You can go to your github account and go to the repository. There you will be able to see your project changes and also the commit details. You can check in the screenshot below:

So this is how you can commit your project or add your project to git repository. 

  • |
  • Git Tutorial for Beginners and Intermediate , Git Tutorial , Git , Github , commit , repository , push , pull request , branches

Comments

Tags

LinkedinLogin
LinkedinProfile
GetLinkedinProfile
C#
Aspnet
MVC
Linkedin
ITextSharp
Export to Pdf
AspNet Core
AspNet
View to Pdf in Aspnet
Model Validation In ASPNET Core MVC 60
Model Validation
Model Validation In ASPNET Core MVC
Model Validation In ASPNET
Image Compression in AspNet
Compress Image in c#
AspNet MVC
Image Optimize in C#
Scheduler
Scheduler Service
Task scheduler in AspNet
Task Scheduler
Git Tutorial for Beginners and Intermediate
Git Tutorial
Git
Github
commit
repository
push
pull request
branches
Git Branching and Merging
Branching
Merging
compress images csharp
compress jpeg csharp
compress png csharp
compress tiff csharp
Slick Slider
Slick Slider Responsive
Csharp
OpenJson
Sql server
Json
How to set Date and time format in IIS Manager
IIS Manager
IIS
Internet Information Services (IIS) Manager
Internet Information Services (IIS)
Internet Information Services
Error Handling In AspNet Core
Exception Handling Asp Net Core
Exception Handling
Exception Handling Asp Net
Creating Log Files in MVC
Error Handling in MVC
Exception Handling in AspNet
Handling Exceptions and Creating Error Logs in Asp net Mvc using base controller
net
Code2Tonight
Stopping Browser Reload On Save
Repository Pattern with ADONet in MVC
Repository Pattern With ASPNET MVC And AdoNet
MVC Crud Operation
Jquery Full Calender Integrated With ASPNET
Full Calendar
Jquery Calendar
Slick Slider Example
responsive carousels
Entity Framework
Intergrate SummerNote Text Editor into AspNet MVC
Web Config
Auto Redirection
Redirection from Http to https
Url Rewriting
Implement Stripe Payment Gateway In ASPNET Core
Stripe Payment Gateway
StripeNet
Convert HTML String To Image In C#
HTMLtoImage
Convert Html to Image in AspNet
Postgre
PgAdmin4
PostgreSql
A Non Fatal Error Occured During Cluster Initialisation In Postgre SQL
Microsoft Outlook
Outlook Appointments
Microsoft Exchange Service
Send Email With HTML Template And PDF Using ASPNet C#
Send Email
Email with html template
email with pdf attachment
email with html and pdf
Microsoft Outlook Contacts
Outlook
Microsoft Exhchange Service
JSON
Convert string with dot notation to JSON
HTTP Error 5025 ANCM Out Of Process Startup Failure
Internet Information Service
Net core
Payumoney Integration With AspNet MVC
Prism js
Highlighting Syntax
Syntax Highlighting
code stylings
c#
Jquery AJax
Ajax
Jquery
Implement Stripe Payment Gateway In ASPNET
Using Checkout in an ASPNET Web Forms application
Stripe Payment
Stripe Payment Integration
Stripe Integeration
How to upload Image file using AJAX andjQuery
upload Image file using AJAX and jquery
Ajax call
file upload using ajax
file uploading using ajax and jquery
ConfigurationBuilder does not contain a definition for SetBasePath
Reading app json file in dot net core
Appsetting jso
Dot Net Core
Globalization and localization in ASPNET Core
Asp Net Core with Resource file resx
How to get the resx file strings in asp net core
Culture in Net core
Localisation in AspNet Core
Url Encryption in AspNet MVC
Url Encryption in C#
Url Encryption
Custom Helpers
Slick Slider with single slide
Slick
Vue js
Child Components
How to reload vue js child components
Net Core
Visual Studio
Net core 31
Razor
Zoom sdk
Zoom c# wrapper Inegration
zoom Integration in c#
Zoom Integration
Zoom window sdk
vue js toggle button
vue js
toggle buttons
vuejs
vue js toggle switch
SignalR
VueJs
SignalR in Net Core
Chat App in Vue js
Chat App using SignalR
AspNet Chat app
JPlayer
Html5 Audio Video Player
Music Player
QR Code Generator
QR Code
Jquery QR Code
Google Maps
Google map api
Places API
Google map Places API in AspNet
Jquery Autocomplete
Autocomplete
Jquery UI Autocomplete
ExcelDataReader
Import data from excel in AspNet
Card Number Formatting
Amex Card Format
Card Format
FCM
Cloud Messaging
Android Notifications
FCM Notifications for IOS
IOS Notifications
Angular js
apply css on child components in Angular js
Angular Mentions
Google Sign In
Google Login
Google Oauth Api
Social Login
Aspnet Mvc
Google + Api
Create and publish a package using Visual Studio (NET Framework
Windows)
Create and publish a nuget package
create your own nuget package
Image compress
Image optimization
compress Image
optimize Image
WebForm
AspNet Web Pages
Batch Script
Database backup
Powershell
ASpNet
Sql Server Backup
AspNet core 31
Aspnet core 21
HttpCookies in AspNet Core
LinkedIn Authentication
Login using LinkedIN
Social Login in AspNet
LinkedIn Authentication in AspNet MVC
LinkedIn Login in aspnet MVC
Shuffle List in c#
C#Net
Google Login in AspNet MVC
GoogleAuthentication Nuget package
Password Encryption
RFC Encryption
Encryption and Decryption
Encryption in AspNet
Base 64 Encryption
Base 64 Decryption
Swagger UI
Swashbuckle
SwashbuckleAspNetCore
Rest API
Postman
Api Testing
SSRS
SSRS Report
ASPNET MVC
ASPNET MVC SSRS Report
ssrs report
XlWorkbook
ClosedXml
Excel Export
Blazor
Syncfusion
SFGrid
Syncfusion SFgrid
Net
Net core 60
DataTable to List
Extension Methods
Microsoft Access Database Engine
Ace Ole Db 120
MicrosoftACEOLEDB120
OLE DB
Aspnet MVC
Ace OLE DB
rdlc
Report Viewer
RDLC Report
Max Request Length

Welcome To Code2night, A common place for sharing your programming knowledge,Blogs and Videos

  • Kurukshetra
  • info@Code2night.com

Links

  • Home
  • Blogs
  • Tutorial
  • Post Blog

Popular Tags

Copyright © 2022 by Code2night. All Rights Reserved

  • Home
  • Blog
  • Login
  • SignUp
  • Contact
  • Json Beautifier