Class-1
1.Git Introduction
2.what is source code management?
3.what is Git?
4.Difference b/w svn and git?
5.How to install git in your windows?
6.How to configure user name and mail id in git
7.Three phases of git
8.How to push your code from local to github?
9.How to create github account?
10.How to give collaboration acesses to team members?
Installation of git in windows?
https://git-scm.com/downloads
touch rushi
touch devops aws
ERROR1:
DELL@DESKTOP-QFK4SRT MINGW64 /d/Feb-2020/ICICI/Fundstransfer
$ git status
fatal: not a git repository (or any of the parent directories): .git
Solution :git init
DELL@DESKTOP-QFK4SRT MINGW64 /d/Feb-2020/ICICI/Fundstransfer (master)
$ git commit -m "developer developing code for fs"
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'DELL@DESKTOP-QFK4SRT.(none)')
Creating github account?
https://github.com/
echo "# Fundstransfer-feb-2020" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/devopsrishi/Fundstransfer-feb-2020.git
git push -u origin master
How to give collaboration acesses?
Open repository --> click on settings --> Collaborators --. Enter github Id
How to download Repository?
git clone https://github.com/devopsrishi/Fundstransfer-feb-2020.git
ERROR: while pushing code to another branch
DELL@DESKTOP-QFK4SRT MINGW64 /d/Feb-2020/ICICI/branch2 (master1)
$ git remote add origin https://github.com/devopsrishi/branch-4.git
fatal: remote origin already exists.
Conflict error
When two developers modifies same file in two different branches and when they try to merge the code conflict error will occur
Create a folder
git init
touch sample
Vi sample
ERROR1:
$ git push -u origin master
To https://github.com/devopsrishi/tag-2020.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/devopsrishi/tag-2020.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Solution:
1. Git pull
2. Git push -u origin master -f
Git tag:
git commit -m "paytm remodfied by dev"
488 git merge dev1
489 vi paytm
490 git add paytm
491 git commit -m "conflicts resolved"
492 git log --oneline
493 history
494 git branch
495 git remote rm origin
496 git remote add origin https://github.com/devopsrishi/branch-4.git
497 git push -u origin feb-release
498 git log
499 git log --oneline
500 git tag -d feb-release may
501 clear
502 git tag
503 git log --oneline
504 git tag latest-release
505 git tag
506 git log --oneline
507 git tag 9f2c00c jan-release
508 git tag jan-release 9f2c00c
509 git log --oneline
510 git tag fundstransfer-bug-fixesc296d17
511 git tag fundstransfer-bug-fixes c296d17
512 git tag
513 git log --oneline
514 git remote add origin https://github.com/devopsrishi/tags-feb-2020.git
515 git remote rm origin
516 git remote add origin https://github.com/devopsrishi/tags-feb-2020.git
517 git push -u origin master
518 git tag
519 git push origin jan-release
520 git push origin fundstransfer-bug-fixes
521 ls
522 history
Creatimg tag:
creating tag
git tag tagname
create multiple tag
git tag tabname1 tagname2
push tag to central repo
git push origin tagname
delete tag locally
git tag -d tagname
delete tag centrally
git push -d origin tagname