Git Class 1 and 2
Git Class 1 and 2
Git is a distributed version control system, which means it manages changes to code and other files over
time, tracking who made what changes and when.
Account creation
Repository creation
Files creation
Code url
Developer settings
Add collaborator
Accept the request for a collaboration from another account
Class 2:
Git Bash:
It is a terminal emulator for Windows that provides a Unix-like command-line environment. It combines
a Windows command-line interface with the Git command-line, allowing you to run Git commands and
perform Git-related tasks in a familiar Unix-like shell environment.
If you want to reset the global configuration for one account using
and
it will remove the associated username and email from the global configuration, effectively making
those fields empty.
Git topics:
git clone:
After cloning everytime you want to get updated with te remote repo in ur local, u do git pull.
git pull: This command fetches changes from a remote repository and merges them into your current
branch. It's a combination of git fetch and git merge.
git pull
git fetch: This command retrieves changes from a remote repository but does not automatically merge
them. It updates your local copy of the remote branches.
git stash:
It allows you to temporarily save changes that you are not ready to commit yet, so you can switch to
another branch or perform other operations without committing your work.
Git branch main
Work on ur development
git add .
git commit –m “”
git push
git tags:
Tags are used to mark specific points in Git history, such as releases. You can create lightweight (simple
labels) or annotated (detailed) tags.
Do changes in ur local
Git add .
Git commit –m “”
check the tags in github repo and u can download that version/release of the code anytime using that
tag number.
Alias:
git config --global alias.co checkout: This creates a shortcut alias for a Git command. In this example, it
creates an alias "co" for "checkout," so you can use git co instead of git checkout.
Gitignore: It's a file that specifies which files or directories Git should ignore when tracking changes.
Useful for excluding build artifacts, temporary files, or sensitive data from version control. Create
a .gitignore file in your repository with patterns for files/directories to ignore.
Logged into your Ubuntu 18.04 server as a sudo non-root user, first update your default packages.
You can confirm that you have installed Git correctly by running this command and receiving output
similar to the following:
git --version
Now that you have Git installed and to prevent warnings, you should configure it with your
information.
If you need to edit this file, you can use a text editor such as nano:
vi ~/.gitconfig
~/.gitconfig contents
[user]
email = youremail@domain.com