0 votes
1 view
in DevOps and Agile by (30k points)

I need to throw away all the changes in my local repository and pull all the code from the remote repository. What is the Git command to do this?

1 Answer

0 votes
by (51.2k points)

You could use these commands

git fetch origin

git reset --hard origin/master

Here 

Origin is the remote repository

master is the branch 

These two commands are used to fetch the commits from the remote repository and positioning your working copy to the master.

And also all local commits that are not committed to the remote will be lost due to -hard option.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...