Loganath Raja
Loganath Raja

Reputation: 33

Will the uncommitted change also will push along in Git?

We follow the Gitflow model. I am trying to merge my branch to develop now. But I have some uncommitted changes also in my branch. I merged successfully. Now the question is when i push my changes to remote, will my uncommitted changes also Push along ? I don't want my uncommitted files to go along as they are required for local testing purpose only. Please do clarify.

Upvotes: 3

Views: 4964

Answers (1)

Krantisinh
Krantisinh

Reputation: 1729

Conceptually speaking, Git has 4 areas: Working, Staging, Repository and Stash.

  1. Whenever you change something, that's present in Working area.
  2. You need to do git add fileName or git add . [to add all changes] to move your files to staging area.
  3. Only those files can be committed which are in staging area.
  4. All the committed files reside in repository area. Only commits can be pushed to remote.

Hence, your uncommitted changes won't be pushed to remote in any scenario unless you commit those and then do git push.

Upvotes: 12

Related Questions