Git is a distributed version control system that tracks changes in any set of computer files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows.
Git is a DevOps tool used for source code management. It is a free and open-source version control system used to handle small to very large projects efficiently. Git is used to tracking changes in the source code, enabling multiple developers to work together on non-linear development.
This is a special daemon that comes packaged with Git; it listens on a dedicated port (9418) that provides a service similar to the SSH protocol, but with absolutely no authentication.
The default SSH port (22) is dedicated to Git and SSH application network traffic.
1. Download git for this link https://git-scm.com/download/win
2. Install git with Git Bash
3. Setup your identity via git config
$ git config --global user.email "email"
$ git config --global user.name "username"
clone: it is means create a local copy of Repository
push: using for pushinf yt=he code on remote repository
pull: pulling the code from remote repository
commit" commit the code from local to staging area
logs: logs means you can see details of previous commit
config: you can see or modify configuration of git users in your local system.
diff: see the difference between previous and new changes
staging area: When you create a git commit, Git takes changes that are in the staging area and make them as a new commit. You are allowed to add and remove changes from the staging area. The staging area can be considered as a real area where git stores the changes.
example: $ git clone https://github.com/mwangiKibui/node.js-simple-api.git
$ git remote add origin remote
- open your terminal and go to source repository where you want merge target repository. Exp: cd demo1
- git remote add -f <new_branch_name> <target_repo_url> Exp: git remote add -f old_demo2 https://github.com/VikashSaharan1/Helloworlld
- git merge <new_branch_name>/<repo_branch_name> --allow-unrelated-histories Example: git merge old_demo2/master --allow-unrelated-histories
- Resolve conflict files Like README.md
- git status
- git add .
- git commit -m "merge demo2 in demo1"
- git push -f origin master
- open your terminal and go to source repository where you want merge target repository. Exp: cd demo1
- git remote add -f <new_branch_name> <target_repo_url> Exp: git remote add -f old_demo2 https://github.com/VikashSaharan1/Helloworlld
- git cherry-pick <commit_id> Example: git cherry-pick d7dda7733ea7a7e5b56095196834f7ae0e48fb45
- git add .
- git commit -m "merge demo2 in demo1"
- git push -f origin master
for /F %r in ('git branch -r') do echo %r
for /F %r in ('git branch -r') do ( git branch --track %r) && git fetch --all && git pull --all
for /F %r in ('git branch') do git switch %r && git pull