05 - GitHub Running Notes (3)
05 - GitHub Running Notes (3)
Git Hub
=========
-> Git Hub is a platform which is used to store project related files/code
-> All the developers can connect to project repository to store all the source
code (Code Integration will become easy)
- who modified
- when modified
- what modified
- why modified
===================
Environment Setup
===================
===============================
What is Git Hub Repository ?
===============================
=> Repository is a place where we can store project source code / files
=> Project team members will connect with git repository using its URL.
1) Public Repo (anybody can see & you choose who can commit)
2) Private Repo (you choose who can see & commit)
====================
Git Bash Commands
====================
git restore : To unstage the files & to discard changes made in files
git pull : To take latest changes from remote repo to local repo
===============
Git Branches
===============
=> Branches are used to maintain multiple code bases in the single repository
1) main (default)
2) develop
3) feature
4) qa
5) uat
6) release
=> If we have branches in git repo then multiple teams can work paralelly without
effecting other teams code.
Note: When we execute 'git clone' command then we will get code from default branch
which is 'main'.
=> In git bash we can switch from one branch to another branch is 'git checkout'
command
===========================
What is Branch Merging ?
===========================
=> Merging changes from one branch to another branch is called as Branch merging.
====================
Git Branches Task
====================
==========================
What is .gitignore file ?
==========================
=> .gitignore is used to exclude files & folders from our commits
Ex: In maven project, we should n't commit target folder to git repository hence
we can give this info to git using .gitignore file.
========================
What is git Conflict ?
========================
=> When two people making changes in same file and same line then we will get
conflicts problem.
============================================
1) How to remove git local commits ?
Note: After executing git revert we have to execute git push also
=> It is used to save working tree changes to temporary area and make working tree
clean.
$ git stash
=> We can get stashed changes back using 'git stash apply'
=> merge & rebase commands are used for branch merging from CLI
# Creating tag
$ git tag <tag-name>
================================
1) git config
2) git init
3) git status
4) git add
5) git commit
6) git push
7) git log
8) git rm
9) git clone
10) git branch
11) git checkout
12) git pull
13) git restore
14) git reset
15) git revert
16) git merge
17) git stash
18) git stash apply
==========================
===================================
===========================
Realtime Work Process
===========================
1) Developers will send request for DevOps team to create git repository for the
project with manager approval.
2) DevOps team will provide Repo Access for team members (RBAC)
3) DevOps team will create git repo and will share that repo URL with Dev Team.
4) Dev team will push their code into git repo and Dev Team will create required
branches also
Note: DevOps team will decide Branching strategy for the project.
5) DevOps team will clone git repo for build and deployment process