Stages in Git
- working directory – developer can make changes in Project folder
- Staging area – make ready what changes done in working dir
- local repository – create commit id and having commit history
- remote repository – having changes in remote location
Gobal configure
git config list - list all configures
git config get <user.email> get specific details
git config set user.email devops@qt.com
git config set user.name ram
git config --gobal user.email devops@qt.com
git config --gobal user.name ram
working on git
# created folder
mkdir multicloud devops qtadmins students
## create file
touch devops/1.md
echo "hello this is my first file" > devops/1.md
## move file to working dir to staging area
git add devops/1.md
## check status
git status
## create multiple files and move to staging ares
echo "hello this is my second file" > students/2.md
echo "hello this is my third file" > qtadmins/3.md
echo "hello this is my fourth file" > multicloud/4.md
## add all files to staging area
git add .
## check git status
git status
## Now move all staging area files to local repository
git commit -m "added files"
## out put
[master (root-commit) bf37b1b] added files
4 files changed, 4 insertions(+)
create mode 100644 devops/1.md
create mode 100644 multicloud/4.md
create mode 100644 qtadmins/3.md
create mode 100644 students/2.md
## check commit id
git log
Task:
- create multiple and do commit id
- edit existng files and do commit
- check differances b/w last two commits
- again do files changes and run
git diffas verify what changes you done.
Local pre-requests:
- vscode
- git
- windows-terminal
- Create Github account click here to sign up
