Git Pull Request Tutorial | Commands | For Beginners
What is Git pull?
- Git pull is used to fetch and merge changes from the remote repository to the local repository
- Git pull is a combination of two commands, git fetch followed by git merge.
This tutorial is for Git beginner who interested to get familiar with the Git Pull Request commands. Expecting that you already have you own account and project or accessible to any Git remote repository with the read and write privilege. Aside, Git Bash apps has been installed in your local machine.
For creating a GitHub account you can go to the https://github.com/.
Step 1
Open Git Bash app.
Step 2
Create a directory :
mkdir git_tutorial
Step 3
Go to the new directory by typing the cd git_tutorial command
Step 4
For checking the current directory you can type the pwd command
Step 5
git init
Once run this command, you will see the .git hidden folder will be created in the git_tutorial directory
Step 6
Now you can start pull project from your Git remote repository by using following command:
git pull http://<github url>.git
Step 7
Then make changes on any file that you have pulled from the Git repository follow by run below command;
git add.
Step 8
For checking status you can run the 'git status' command
Step 9
git commit -m "<comment>"
For running above command you need to ensure that you email has been registered in your local machine. Below are the command for registering your email/name.
git config --global user.name "Your Name"
Step 10
git remote add origin http://<github url>.git
Step 11
git status
Step 12
For checking the remote status
git remote -v
Step 13
git push -u origin master
You changes will be updated in the GitHub remote repository.
Comments
Post a Comment