How to push commit to GIT

How to push commit to GIT

If you wish to update your repository with command line, it is very simple. Today I'll show you how to do that

Step 1: Check branch changes

It’s important to be aware of what’s happening and the status of your changes. When you add, change, or delete files/folders, Git knows about it. To check the status of your changes:

git status

Step 2: Staging your changes

You’ll see any local changes in red when you type git status. These changes may be new, modified, or deleted files/folders. Use git add to first stage (prepare) a local file/folder for committing. Then use git commit to commit (save) the staged files:

git add .

Step 3: add commit


Step 4: push changes

For example, to push your local commits to the master branch of the origin remote:

git push origin master

That's it, you have updated your repository.

- Last updated 1 year ago

Be the first to leave a comment.

You must login to leave a comment