GiT RW
GiT RW
git branch feature-branch This will create a new branch of the master branch
in which the contents and files are copied from the master branch.
git branch This command will show all the branches which we have made
and the current branch will be in green colour.
Step 2:
Here in the feature-branch we staged the file and commit with appropriate
message that “1st line of FB (v1)”.
So here the file has been changed ,but in the master branch it will be as it is
until we merge the feature-branch with the master branch.
Step 4:
For merging the file to the master branch we first need to move to the
main/master branch using “git checkout master” command.
Then we can merge the branch with “git merge feature-branch” command.
So ,now the files will be merged ,the changes or the edits in the feature-branch
will be merged.
Step 5:
file(file.txt).
Step 2:
Step 4:
After stashing we check status using “git status” ,there it shows that the
file(file.txt) is modified but not staged yet.
After committing the changes we can see the log of the repository.
4. Collaboration and Remote Repositories
:
Clone a remote Git repository to your local machine.
Step1:
To clone a remote git repository ,first we need to open the github.com and open
any of the account on the github.com
After that we have chosen the repository which we want to clone into our local
machine.
After choosing the repository , in that repository we clicked on the green
button “code” ,which open a drop down list of links in that ,we copied the
“HTTPS” link from that. https://github.com/Abhishek-4949/Demo.git
Step2:
In the second step we need to open our git bash and in some directory where
you need to clone the remote repository we need to move to that location using
“cd <path name> “ command.
Here we want to copy the repository to the folder clone in the c so we moved to
that location
git clone https://github.com/Abhishek-4949/Demo.git this command will
copy the repository from remote to the local machine in the working directory.
you can see above the “Demo” repository is successfully copied in the clone
directory/folder.