4.2.5. Common Online (Remote) Operations with Git¶
4.2.5.1. Get Changes and overwrite local work-area¶
This command is equivalent to svn update
git pull
4.2.5.2. Get Changes but don’t modify local work-area¶
If you don’t want to modify your local work area, just run:
git fetch
This will fetch changes from Server, but it will not modify anything in your local work area.
4.2.5.3. Check if work-area is latest¶
If you are on a git work area, and you want to know whether you are on latest code or not.
First, you need to fetch changes from the server.:
git fetch
Now, you are aware of all changes from server. Git is distributed in nature, and hence this step is required.
Now run:
git branch -vv
Using this command, you will know what is status of your branch.
If you run:
git branch -vvv
It will show you status of all branches that you have check out in your work area.
4.2.5.4. VS Code¶
If you are using VSCode as your IDE, then there are settings in for git to auto fetch changes from Git repositories.
If you enable this, VSCode will keep fetching the changes from remote server in background to make you aware where you stand relative to latest changes on upstream server.
"git.autofetch": true