Git Github Session
Git Github Session
GitHub Basics:
Practical Examples for
Beginners
Difference between Git and GitHub
6. https://git-scm.com/downloads/ https://github.com/
win
Alternatives to GitHub
● GitLab
● Bitbucket
● SourceForge
● Codeberg
● Azure DevOps
● AWS CodeCommit
● Gitea
Git Working
Git Commands and Working with Git Bash
1. git init - to initialize the git repository
2.2.
4. git remote add origin repo_url - adding the git URL as an alias
5. git status - show the modified files in the working directory with the branch name
6. git commit -m “message”- to save the modified files to the working directory.
7. git push origin source_name - to push the changes in the working directory to remote server.
8. git branch / git branch -a - shows all the available branches in the repository. Active
branch contains * next to it.
9. git checkout -b branch_name - creates a new branch and switches to newly created branch.
10. git branch - - delete branch_name / git branch -D branch_name - deletes the branch.
11. git checkout branch_name / git switch branch_name - switches to another branch and
check it out into your working directory
12. git merge branch_name - merge the specified branch’s history into the current one
13. Git pull / git pull origin branch_name - fetch and merge any commits from the tracking
remote branch
16. git diff branchB branchA - To compare branchA against branchB and see the changes that
are in branchA but not in branchB.
17. git reset filename - unstage a file while retaining the changes in working directory.
18. git clone url - to clone the remote repository (project) to the local environment( machine) .
19. git reset –hard commit_id -it tries to delete the wrongly committed changes in remote repo
and points to previous commit id.
20. git clone url - to clone the remote repository (project) to the local environment( machine) .
21. git rebase branch_name - apply any commits of current branch ahead of specified one
22. git restore filename - discard the unstaged file from the local directory.
Contact Details :
Name: Shanmuga Priya
Email : [email protected]
Thank You All : )