Simple Git workflow with Remote Repository
Here’s a simple workflow to follow:
Before starting work: Run git pull to fetch the latest changes from the remote repository.
After making changes: Commit your changes and push them back to the remote repository to keep it synced with your other computers.
- use
git status
to see what tracked files have changes. - before modified tracked files can be commited, they need to be staged.
git add <filename>
to stage a modfied filegit commit -m "insert commit message"
will commit the file changes and message- you can skip the add step and do it with the commit step if you use the -a flag
- Before pushing: Always pull to avoid conflicts if someone else has pushed changes in the meantime.