Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Git Problem Statement 1 30 March.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
que1:-
step1:- suppose three developer create their feature branch as they wanted to change in the main branch. so to cretae a feature branch :-
git branch featureb1
git branch featureb2
git branch featureb2
these feture branch create by three different developer
step2:- to add file on these branch we have
git add .
git add filename
step3:-now to commit the changes in file :-
git commit -m"message"
step4:- to push the file to the feature branch :-
git push origin branch_main
step5:-now developers merge their feature branches to the main branch so first they checkout to the main branch then merge their feature branches to it.
git checkout main_branch
git merge feature_branchname
39 changes: 39 additions & 0 deletions Git Problem Statement 1 6 April.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Fork the Repository:

Go to the GitHub repository you want to contribute to.
Click on the "Fork" button in the top right corner of the repository page.
This creates a copy of the repository under your GitHub account.
Clone the Forked Repository:

On your forked repository page, click on the "Code" button and copy the repository URL.
Open your terminal or Git bash and use the git clone command followed by the repository URL to clone the repository to your local machine:
bash
Copy code
git clone <repository URL>
Create a New Branch:

Change to the directory of the cloned repository using cd.
Create a new branch using the git checkout -b <branch-name> command:

git checkout -b feature/new-feature
Make Changes and Commit:

Make changes to the code or files in your local repository
Use git add . to stage all changes
Commit your changes
git commit -m "Your commit message here".
Push Changes to Your Fork:

Push your branch to your forked repository:
git push origin feature/new-feature

Create a Pull Request (PR):

Go to your forked repository on GitHub.
GitHub will detect that you pushed a new branch and offer a button to create a pull request.
Click on "Compare & pull request" to start creating a pull request.
Provide a title and description for your pull request, and then click "Create pull request".
Review and Merge:

The maintainers of the original repository will review your changes in the pull request.
If everything looks good, they will merge your changes into the main branch of the original repository.
13 changes: 13 additions & 0 deletions Git Problem Statement 2 30 March.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Step1:- suppose here we create new branch as they wanted to change in the main branch. so to cretae a new branch :-
git branch newbranch
In this branch we add some file in it
Step2:- to add file on these branch we have
git add .
git add assignment2.html
Step3:-now to commit the changes in file :-
git commit -m"message"
Step4:- to push the file to the feature branch :-
git push origin newbranch
Step5:-now developers merge their new branche to the main branch so first they checkout to the main branch then merge their feature branches to it.
git checkout master
git merge newbranch
8 changes: 8 additions & 0 deletions Git Problem Statement 2 6 April.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Sure, here are the key points about feature branches in Git:

- Feature branches are created to work on specific features or enhancements in a project.
- They isolate changes, preventing them from affecting the main development branch.
- Multiple developers can work on different features simultaneously using feature branches.
- Feature branches facilitate code review, testing, and integration with CI/CD pipelines.
- They maintain a clean version control history, making it easier to track changes related to specific features.
- Feature branches encourage collaboration among team members by providing a focused environment for feature development.
15 changes: 15 additions & 0 deletions Git Problem Statement 3 30 March.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
step1:- to create a git repository in hub
go to github and login your account
step2:- on right side corner click on "+" to add new repository in the hub.
step3:- enter the name of repository
step4:- add description if necessary as it is optional.
step5:- now click on create repository
now to clone your repository to the the system following commands are run on terminal.
step6:- git clone "linkof the repossitory"
step7:- now we have file and you want to change in it then do the changes.
step8:- now, to add the file use
git add file_name
step9:- to make snapshot of your files commit these changes in staging area
git commit -m"message"
step10:- to push the file in remote repository
git push origin main
9 changes: 9 additions & 0 deletions Git Problem Statement 3 6 April.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Here are the key points about the release branching strategy:

- Employed before software releases or deployments to production.
- Involves creating a separate release branch from the main development branch.
- Stabilizes code, performs final testing, and prepares for deployment in the release branch.
- Isolates release-related changes from ongoing development in the main branch.
- Allows for hotfixes to be applied directly to the release branch if critical issues are discovered.
- Facilitates activities like documentation updates, version number incrementation, and packaging for the release.
- Provides clear versioning by associating each release branch with a specific version of the software.
16 changes: 16 additions & 0 deletions Git Problem Statement 4 30 March.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Check the commit history
git log --oneline

# Remove the sensitive file from the commit
git filter-branch --index-filter "git rm --cached --ignore-unmatch path/to/sensitive-file" HEAD

# Force push to update the remote repository
git push origin main --force

# Add the sensitive file to .gitignore
echo "path/to/sensitive-file" >> .gitignore

# Commit and push the changes to update .gitignore
git add .gitignore
git commit -m "Update .gitignore to exclude sensitive file"
git push origin main