Introduction to git and githhub with practicals.pptx

abdulsalam1122 13 views 11 slides May 12, 2024
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

Git and Github slides.


Slide Content

Git and Github

Git is a version control system, it helps us to track the changes made in our code/projects. Git is the most popular version control system in th e software development field. It is free and open source software. I t is fast and can be used in large projects. What is ?

If you are working in a team, Git is best for you. It supports multiple programmers working simultaneously.

Github is a website used to host your code, and manage the code with the help of Git. O n gihub code is stored in folder like structure, that is known as repository or repo. What is ?

1) Create account on github. 2) Create repository

Download Git software Local projects and remote projects Clone repo to host the code. Git clone and the url Git clone https://github.com/abdul-salam111/GitandGithub_Session_repo.git Git status -> to check the changes Create a new local file. Untracked files

Git commands G it add file name. G it add . ( to add all files) Staging Area The staging area is a file, generally contained in your Git directory, that stores information about what will go into your next commit. Git commit (git commit –m “message” git commit  creates a  commit , which is like a snapshot of your repository. These  commits  are snapshots of your entire repository at specific times.

G it commands G it push ( git push origin main) U pload the local changes to github repository. U ploading new project to the github git init git add README.md git commit -m "first commit" git branch -M main git remote add origin https:// github.com /abdul-salam111/new- repo.git git push -u origin main

G it commands Switching between branches G it checkout main ( branch name) P ushing branches to the github G it push origin feature1 -> branch name

G it commands C omparing branches G it diff main –>branch name >>> first we have to commit somehting M erging branches Git merge feature2 ->branch name Deleting branches Git branch –d feature2 ->branch name If some conflicts in merging use this command git push -f -u origin (branch name)

Thank you Follow me on LinkedIn for more updates and sessions https://www.linkedin.com/in/abdulsalamas/