I am working on a local branch (let us call it bugFix123
), I normally use the following command sequences to push changes,
1. git add to add files
2. git commit -m 'description' (there could be multiple sequence of 1 and 2, suppose I have multiple commits for multiple changes, and using one single push in the final)
3. git push origin bugFix123
here is a new question, suppose I commit
multiple times for multiple local changes, before I execute command git push origin bugFix123
, how to see what are the final files to push? I tried to use command git commit
, it seems git commit
does not display the right file list to push (if there are multiple commits, before push). The purposeI want to see the final file list to push in multiple commit scenario is because I do not want to push unnecessary files and further fix them (it will send incorrect push list file notifications to others).
Edit 1,
I find git push -n
not always work,
git push -n
To git@github.com:foo/goo.git
! [rejected] master -> master (non-fast-forward)
! [rejected] update12_1 -> update12_1 (fetch first)
error: failed to push some refs to 'git@github.com:foo/goo.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
regards, Lin