Git - Interview Questions
Git - Interview Questions
GIT - CONFLICT MERGE - EXTRA COMM, additional commits reflecting only in master
MERGE TOOL
GIT - REBASE - PROACTIVE MONITORING - fb
GIT - STASH -
GIT - CHERRY-PICK- Picks particular commit from master to fb - FB
GIT - PULL - FETCHING FROM RR TO LR; MERGING LR TO WD...
GIT - CLONE - ENABLES HIGH LEVEL BACKUP OF THE SOURCE CODE
GIT - FORK - GITHUB
GIT REVIEWS:
============
3. GIT -
4. GIT :
GITHUB :
5. GIT FLOW :
6. GIT INSTALLATION :
27 How will you find out if a branch has already been merged or not?
"
Ans.�We use the following commands to find out if a branch has already been
merged or not:�
git branch �merged master � it will list all the branches that
have been renamed into master.
git branch �merged � it lists the branches that
have been merged into the current branch (HEAD).
git branch �no-merged �
it lists the branches that have not been merged.
"
28 What is the difference between Git stash apply and Git stash pop?
Old Reviews:
============
AWS Cloud computing: Services - from all 6 engs
Project management
- Fastest delivery of Software
- End to end Automation
- Development , testing , Production and DR --- ENVIRONMENTS => Who provide this
"AWS"
- Coding + testing + impl + end user access
SDLC Models
Traditional scm
Types of VCS
Practicle:
1. EC2 Server - Linux : 65.0.179.147 ; ec2-user
2. Git installation
3. Git Configuration
4. Git commands
https://github.com/Akshiv20/straighttobank.git
Advanced:
=========
push:
1. branch
default branch - master or main
git branch dev
dev - feature branch creation
source also copied from master to dev branch
2. merge
Normal merge - no problem -- base of master and dev are same
master: 1 2
dev : 1 2
merge conflict
master: 1 2 3 - merge conflict
dev : 1 2 4
4. cherry-pick:
master: 1 2 3 4
dev : 1 2
5. clone
8. fork
5. Types VCS
- Local : Version wise + locally maintained - backup and recovery
- Centralized : many devs to one single cen repo; Back and recovery; 100% net
- Distributed : Local repo + clone + copy of source code maintained here; GIT
7. Stages of GIT:
Working Directory
Staging Area
Local Repository
Remote repository
8. SET-UP:
1. EC2 SERVER CREATION
2. GIT SOFTWARE INSTALLATION
3. GIT CONFIGURATION
Types of Configuration
-> --global -- deticated to private user
-> Public git server -- anyone can access
4. git config -l
5. winscp - protocol --> local to remote server upload and download of source
codes
6. Working directory : mkdir mygit ; cd mygit
7. git init --> .git - hidden folder - Local repository
8. GITHUB - Remote repository - "Appropriate repository" - URL
9. vi sample.txt
git status => untracked or uncommited ; git add
git add . => source moved from wd to sa
git add filename
git add --all
git status?
git commit -m "first commit" => SA to LP
git status? Nothing to commit; on branch master or main push - source code
"sample.txt"
GIT REVIEWS:
============
4. GIT : software
GITHUB : web service
5. GIT FLOW : GIT = Working dir, staging area, local repo, GITHUB= remote repo
8. GIT - WORKING DIRECTORY : mkdir <name of the directory>; cd <name of the dir>
9. GIT LOCAL REPOSITORY : git init --- .git (hidden dir)
10. GIT BASIC COMMANDS : add, commit, push, log, status, show, blame, diff
19. GIT STASH : buffer location, when we unsure we can use this and reuse the
source code unlike staging area
1 clear
2 git --version
3 git config --global user.name �Akshiv20�
4 git config --global user.email �queenprince20@gmail.com�
5 git config --global core.editor vim
6 git config --global core.compression 2
7 git config --global diff.tool vim.diff
8 git config -l
9 mkdir workdir
10 cd workdir/
11 git init
12 clear
13 git branch
14 vi sample
15 git status
16 git add sample
17 git status
18 git branch
19 git commit -m "First Commit"
20 clear
21 git branch
22 git log --oneline
23 git branch dev
24 git branch
25 git checkout dev
26 git branch
27 git log --oneline
28 vi sample
29 git commit -am "Second Commit"
30 git log --oneline
31 git checkout master
32 git log --oneline
33 git merge dev
34 clear
35 git brancg
36 git branch
37 git log --oneline
38 git branch
39 git checkout dev
40 git checkout master
41 git remote add origin https://github.com/akshiv2011/Veralevel.git
42 git remote -v
43 git push origin master
44 clear
45 git branch
46 git log --oneline
47 git checkout dev
48 git log --oneline
49 git checkout master
50 vi sample
51 git commit -am "Third Commit Fro mMaster"
52 git log --oneline
53 git checkout dev
54 git log --oneline
55 vi sample
56 git commit -am Commit from Feature Branch"
57 clear
58 git commit -am "Commit from Feature Branch"
59 git log --oneline
60 git checkout master
61 git merge dev
62 git config --global merge.toolvimdiff
63 git config --global merge.conflictstyle diff3
64 git config --global mergetool.prompt false
65 git mergetool
66 clear
67 git branch
68 git merge dev
69 git commit -am "Extra merge Commit - 5"
70 git log --oneline
71 history
72 clear
73 git log --oneline
74 git branch
75 git checkout dev
76 git log --oneline
77 git rebase master
78 git log --oneline
79 clear
80 cd ..
81 mkdir workd
82 cd workd
83 git init
84 clear
85 vi cher
86 git commit -am "1 com"
87 git status
88 git add cher
89 git commit -m "1 com"
90 clear
91 git branch
92 git checkout fea
93 git branch fea
94 git checkout fea
95 git log --oneline
96 git checkout master
97 vi cher
98 git commit -am "2 com"
99 vi cher
100 git commit -am "3 com"
101 git log --oneline
102 git checkout fea
103 git log --oneline
104 git cherry-pick 5353e43
105 clear
106 git branch
107 git log --oneline
108 git rebase master
109 git log --oneline
110 CLEAR
111 clear
112 git branch
113 vi cher
114 git stash
115 git stash list
116*
117 git stash
118 git stash list
119 git stash pop stash@{1}
120 git stash list
121 ls
122 vi cher
123 clear
124 cd -
125 ls
126 pwd
127 git clone https://github.com/akshiv2011/Veralevel.git
128 ls
129 cd Veralevel
130 ls
131 rm -rf Training.xlsx
132 ls
133 git pull https://github.com/akshiv2011/Veralevel.git
134 cd ..
135 clear
136 ls
137 mkdir vl2
138 git init
139 cd vl2/
140 git init
141 clear
142 vi sour
143 git add .
144 git commit -m "1 com"
145 git remote add var https://github.com/akshiv2011/veraleveltwo.git
146 git push var master
147 cd ..
148 ls
149 cd Veralevel
150 ls
151 git pull https://github.com/akshiv2011/veraleveltwo.git
152 clear
153 git pull --allow-unrelated-histories
https://github.com/akshiv2011/veraleveltwo.git
154 ls
155 clear
156 history