Skip to content

Commit fded516

Browse files
committed
changes
1 parent c5ceae9 commit fded516

51 files changed

Lines changed: 1707 additions & 92 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

git/GitEYTOC.txt

Lines changed: 96 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,8 @@ In summary, git commit is used to create a new commit in Git, which records the
431431
• Git reset
432432

433433

434+
435+
434436
Refer my presentation "Git_OneDay.ppt" slide number 53 then continue if required.
435437

436438
undo changes a
@@ -532,97 +534,6 @@ Untracked files:
532534
(use "git add <file>..." to include in what will be committed)
533535
file3.txt
534536
This output shows that file1.txt has been modified and staged, file2.txt is a new file that has been added to the staging area, and file1.txt has been modified but not staged yet. Additionally, there is an untracked file called file3.txt that has not been added to the staging area.
535-
-----------------------------------------------------------------------------------------------------------
536-
• Git merge
537-
538-
539-
combine/merge changes from two or more branches.
540-
Here are some of the common use cases of Git merge:
541-
542-
Integrating feature branches:
543-
create separate feature branches
544-
to work on specific features or fixes.
545-
Git merge
546-
merge these branches
547-
into the main development branch (e.g. master branch)
548-
integrate the changes
549-
create a cohesive codebase.
550-
551-
Resolving conflicts:
552-
Two or more branches
553-
can contain conflicting changes.
554-
Git provides tools
555-
identify conflicts
556-
resolve conflicts
557-
merge the changes in a way that preserves the work of all contributors.
558-
559-
Branch maintenance:
560-
Git merge
561-
Import changes changes from one branch into another.
562-
useful when maintaining long-lived branches
563-
e.g. release branch
564-
receives bug fixes from multiple development branches.
565-
566-
Collaboration:
567-
Git merge
568-
essential for collaborative software development.
569-
Developers
570-
work on their own branches
571-
then merge changes into a shared branch
572-
allow to work on separate tasks
573-
without interfering with each other's work.
574-
575-
-----------------------------------------------------------------------------------------------------------
576-
• Git push
577-
578-
Github recently stopped support for password based push. Hence use ssh.
579-
This may fail if you clonned on linux using https and setup ssh access
580-
git remote rm origin
581-
git remote add origin git@github.com:<user>/last-part-of-repo.git
582-
e.g. git remote add origin git@github.com:vilasvarghese/docker-k8s.git
583-
584-
585-
git push
586-
upload local repository changes
587-
to a remote repository.
588-
make changes to files in your local repository, you can use the git push command to send those changes to a remote repository, such as GitHub, GitLab, or Bitbucket. Here are the steps to use the git push command:
589-
590-
First, make sure you have changes to push by checking the status of your local repository using the git status command.
591-
592-
Next, add the changes you want to push to the staging area using the git add command. For example, if you want to push all changes, use the command git add ..
593-
594-
Once you have added the changes to the staging area, create a commit for those changes using the git commit command. For example, use the command git commit -m "Commit message" to create a commit with the message "Commit message".
595-
596-
After creating the commit, use the git push command to upload the changes to the remote repository. For example, use the command git push origin master to push the changes to the master branch of the remote repository.
597-
598-
If you are pushing to a remote repository for the first time, you may need to specify the remote repository URL using the git remote add command. For example, use the command git remote add origin https://github.com/username/repository.git to add a remote repository named "origin".
599-
600-
If your push fails due to conflicts with the remote repository, you may need to pull changes from the remote repository before pushing your changes. Use the git pull command to pull changes, resolve any conflicts, and then try the git push command again.
601-
602-
That's it! You have successfully pushed changes from your local repository to a remote repository using the git push command.
603-
604-
605-
-----------------------------------------------------------------------------------------------------------
606-
• Git pull
607-
608-
download changes from a remote repository
609-
merge them into the local repository.
610-
When you collaborate with others on a Git project, you may need to download the latest changes made by others and merge them into your local repository. Here are the steps to use the git pull command:
611-
612-
First, make sure you are in the local repository that you want to update.
613-
You can check the current repository using the
614-
git remote -v command.
615-
616-
617-
If there are any conflicts between the local repository and the remote repository,
618-
Git will prompt you to resolve them.
619-
Follow the instructions on the screen to resolve the conflicts manually.
620-
621-
Once the merge is complete,
622-
use the git status command to check the status of the local repository.
623-
It should show that the local repository is up to date with the remote repository.
624-
625-
That's it! You have successfully downloaded changes from a remote repository and merged them into your local repository using the git pull command.
626537

627538
----------------------------------------------------------
628539
Git Branching
@@ -813,6 +724,100 @@ N.B: If you get permission denied error
813724
git diff main..second-branch
814725
git diff origin/main..main
815726

727+
---------------------------
728+
729+
730+
-----------------------------------------------------------------------------------------------------------
731+
• Git merge
732+
733+
734+
combine/merge changes from two or more branches.
735+
Here are some of the common use cases of Git merge:
736+
737+
Integrating feature branches:
738+
create separate feature branches
739+
to work on specific features or fixes.
740+
Git merge
741+
merge these branches
742+
into the main development branch (e.g. master branch)
743+
integrate the changes
744+
create a cohesive codebase.
745+
746+
Resolving conflicts:
747+
Two or more branches
748+
can contain conflicting changes.
749+
Git provides tools
750+
identify conflicts
751+
resolve conflicts
752+
merge the changes in a way that preserves the work of all contributors.
753+
754+
Branch maintenance:
755+
Git merge
756+
Import changes changes from one branch into another.
757+
useful when maintaining long-lived branches
758+
e.g. release branch
759+
receives bug fixes from multiple development branches.
760+
761+
Collaboration:
762+
Git merge
763+
essential for collaborative software development.
764+
Developers
765+
work on their own branches
766+
then merge changes into a shared branch
767+
allow to work on separate tasks
768+
without interfering with each other's work.
769+
770+
-----------------------------------------------------------------------------------------------------------
771+
• Git push
772+
773+
Github recently stopped support for password based push. Hence use ssh.
774+
This may fail if you clonned on linux using https and setup ssh access
775+
git remote rm origin
776+
git remote add origin git@github.com:<user>/last-part-of-repo.git
777+
e.g. git remote add origin git@github.com:vilasvarghese/docker-k8s.git
778+
779+
780+
git push
781+
upload local repository changes
782+
to a remote repository.
783+
make changes to files in your local repository, you can use the git push command to send those changes to a remote repository, such as GitHub, GitLab, or Bitbucket. Here are the steps to use the git push command:
784+
785+
First, make sure you have changes to push by checking the status of your local repository using the git status command.
786+
787+
Next, add the changes you want to push to the staging area using the git add command. For example, if you want to push all changes, use the command git add ..
788+
789+
Once you have added the changes to the staging area, create a commit for those changes using the git commit command. For example, use the command git commit -m "Commit message" to create a commit with the message "Commit message".
790+
791+
After creating the commit, use the git push command to upload the changes to the remote repository. For example, use the command git push origin master to push the changes to the master branch of the remote repository.
792+
793+
If you are pushing to a remote repository for the first time, you may need to specify the remote repository URL using the git remote add command. For example, use the command git remote add origin https://github.com/username/repository.git to add a remote repository named "origin".
794+
795+
If your push fails due to conflicts with the remote repository, you may need to pull changes from the remote repository before pushing your changes. Use the git pull command to pull changes, resolve any conflicts, and then try the git push command again.
796+
797+
That's it! You have successfully pushed changes from your local repository to a remote repository using the git push command.
798+
799+
800+
-----------------------------------------------------------------------------------------------------------
801+
• Git pull
802+
803+
download changes from a remote repository
804+
merge them into the local repository.
805+
When you collaborate with others on a Git project, you may need to download the latest changes made by others and merge them into your local repository. Here are the steps to use the git pull command:
806+
807+
First, make sure you are in the local repository that you want to update.
808+
You can check the current repository using the
809+
git remote -v command.
810+
811+
812+
If there are any conflicts between the local repository and the remote repository,
813+
Git will prompt you to resolve them.
814+
Follow the instructions on the screen to resolve the conflicts manually.
815+
816+
Once the merge is complete,
817+
use the git status command to check the status of the local repository.
818+
It should show that the local repository is up to date with the remote repository.
819+
820+
That's it! You have successfully downloaded changes from a remote repository and merged them into your local repository using the git pull command.
816821

817822

818823

0 commit comments

Comments
 (0)