git config --global user.
name "rekha"
git config --global user.email "rekha.ubbu@gmail.com"
git config --list
git help config
git config --help
https://screenrec.com/share/yPRdXMp6HS
git pull will pull all the codes all the changes made after commit which will be
vailable in happen on our local and git fetch will show what are changes are
available. it wont pull all the codes into ur system.
hard revert & soft revert
if u dnt want commit id then u can go with hard revert but then if u want that
commit id to be present then u can go with ur revert soft revert ---git reset --
hard HEAD~1
git stash: If I work on branch A and suddenly need to work on branch B before being
ready with a commit on branch A, I stash my changes on A, checkout B, do my work
there, then checkout A and apply the stash.
Forking is just containing a separate copy of the repository and there is no
command involved. Cloning is done through the command ‘git clone‘ and it is a
process of receiving all the code files to the local machine.
git reset is used to undo changes in your working directory that haven't been
committed yet. It doesn’t create any new commit.
git revert <commit ID>
git merge & rebase: Git squash is a technique that helps you to take a series of
commits and ... git rebase -i is an interactive tool that helps you to squash
commits.
Git rebase and merge both integrate changes from one branch into another. Where
they differ is how it's done. Git rebase moves a feature branch into a master. Git
merge adds a new commit, preserving the history.
To "squash" in Git means to combine multiple commits into one. You can do this at
any point in time (by using Git's "Interactive Rebase" feature), though it is most
often done when merging branches.
In case you did push publicly (on a branch called 'master'):
git checkout -b MyCommit //save your commit in a separate branch just in case (so
you don't have to dig it from reflog in case you screw up :) )
revert commit normally and push
git checkout master
git revert a8172f36 #hash of the commit you want to destroy
# this introduces a new commit (say, it's hash is 86b48ba) which removes changes,
introduced in the commit in question (but those changes are still visible in the
history)
git push origin master
what is push request?
what is the diff reset & revert
Switch to a Branch In Your Local Repo ---o git checkout my-branch-name
Switch to a Branch That Came From a Remote Repo --- • git pull
Run this command to switch to the branch: -- • git checkout --track origin/my-
branch-name
If your local branch does not exist on the remote, run either of these commands:
git push -u origin my-branch-name ---
To delete a remote branch ---o git push origin --delete my-branch-name
To delete a local branch, ---o git branch -d my-branch-name
git init
git status
git is a version control system. it let u track changes make profile and alows u to
revert back to any particular changethat u wish to it is distribted architecture
that provides many advantages over other vcs like SVN.
one of the major advantage is that it does not rely on a central server to store
all the versions of of a prjects files
git and git hub
how do u fix a broken command-- git cmment --amend
how do u revert a commit that has already been pushed and made public
ans: remove or fix the bad file in a new commit and then push it to the remote
repository. nce u make necessary changes in file
confilts
what is git tree
ans: git is tree represents a tree object including mode and name of each item and
the SHA -1 vaue of the tree
git stash --------stashing takes ur working directory that is ur modified tracked
files and staged changes and saves it on a stack of unfinished changes that u can
reapply at any tym.
explain the diff beteen git status and diff
list of files ---------git diff-tree-r#
git diff-tree --no-commit-id --name -only -r (hash)
git diff depicts the changes between commits
what is transitive dependency?
git reset -p for removing single file from staging area