Git1 1
Git1 1
Cluster: i-Alpha
Department: DCSE
After installation, configuring Git with user credentials ensures proper identification
when making commits. Additionally, setting up SSH keys or HTTPS authentication
allows secure interaction with remote repositories.
Procedure:
1. Download Git Client:
o Visit the official Git website and download the latest version suitable for your
operating system (Windows, macOS, or Linux).
2. Install Git:
o Run the downloaded installer and follow the installation wizard, selecting the
recommended settings.
3. Verify Installation:
o Open a terminal or command prompt and run the following command to check if
Git is installed successfully:
4. Configure Git User Information:
Set up your name and email to associate commits with your identity:
Theory:
Whenever you make a repository in GitHub, not everyone has the permission to
change or push codes into your repository. The users have a read-only access. In
order to allow other individuals to make changes to your repository, you need to
invite them to collaborate to the project.
GitHub also restricts the number of collaborators we can invite within a period
of 24 hours. If we exceed the limit, then either we have to wait for 24-hours or
we can also create an organization to collaborate with more people.
Being a collaborator, the user can create, merge and close pull requests in the
repository. They can also remove them as the collaborator.
Procedure:
2.Three-Way Merge: If both branches have unique commits, Git creates a new
Procedure:
1. Check Existing Branches:
Before merging, ensure you are on the branch where you want to integrate changes
Or
3. Merge the Other Branch (e.g., feature-branch):
If conflicts arise, Git will notify you. Open the conflicting files, resolve the issues, and
mark them as resolved:
collaboration by ensuring that all contributors have access to the latest code
changes.
• Git Push:
o The git push command uploads local commits to the remote repository.
o It updates the remote branch with changes from the local branch.
• Git Pull:
o The git pull command fetches and merges changes from the remote repository
into the local branch.
o It ensures that the local repository is up-to-date with the latest remote changes.
These operations prevent version conflicts and help maintain a consistent workflow in
collaborative projects.
Procedure:
Pushing Changes to a Remote Repository