2. • 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 the
software development field.
• It is free and open source software.
• It is fast and can be used in large projects.
What is ?
3. • If you are working in a team, Git is best for you. It supports multiple
programmers working simultaneously.
4. • Github is a website used to host your code, and
manage the code with the help of Git.
• On gihub code is stored in folder like structure, that
is known as repository or repo.
What is ?
6. 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
7. Git commands
• Git add file name.
• Git 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.
8. Git commands
• Git push (git push origin main)
• Upload the local changes to github repository.
• Uploading 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
9. Git commands
• Switching between branches
• Git checkout main ( branch name)
• Pushing branches to the github
• Git push origin feature1 -> branch name
10. Git commands
• Comparing branches
• Git diff main –>branch name >>> first we have to commit somehting
• Merging 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)
11. Thank you
Follow me on LinkedIn for more updates and sessions
https://www.linkedin.com/in/abdulsalamas/