| |
|
Git Commands Part3
Below are the 12 most essential Git command that we used on daily basis are explain below:-
(7)Git push Command
When we say about the Git Push COmmand it is used to upload your local repository content to a remote repository. And when we say about "Pushing" it is an act of transfer commits from your local repository to a remote repo. We can also say that Git Fetch is complement to this Git Push command whereas fetching imports commit to local branches on comparatively pushing exports commits to remote branches. We can configure Remote branch by using Git Remote Command. Pushing is capable of overwriting changes, and caution should be taken when pushing.
Below is the use of Git Push command:-
Git push origin master"
We use above commands to sends the changes made on the master branch to your remote repository. Below is the syntax of command:-
$ git push [variable name] master"
width="100%" />
Git push -all
And above command will pushes all the branches to the server repository.
Syntax
$ git push --all
width="100%" />
(8)Git pull Command
Well pull command is mainly used to receive data from GitHub. And it fetches and merges changes on the remote server to your working directory.
Syntax
$ git pull URL
width="100%" />
(9)Git Branch Command
This command is mainly used to get lists all the branches available in the repository.
Syntax
$ git branch
width="100%" />
(10)Git Merge Command
This command is used to merge the specified branchs? history into the current branch.
Syntax
$ git merge BranchName
width="100%" />
(11)Git log Command
Well this command is used to check the commit history.
Syntax
$ git log
width="100%" />
And by default, if we will not pass argument passed, Git log shows the most recent commits first. We can limit the number of log entries displayed by passing a number as an option, such as -3 to show only the last three entries.
$ git log -3
(12)Git remote Command
Well we used Git Remote command to connect your local repository to the remote server. And this command will allows you to create, view and delete connections to the other repositories. And these connections are more like bookmarks rather than direct links into other repositories. And this command does not provide real-time access to repositories.
width="100%" />
Now to next step | |
|
|
|
|