dhS
dhS

Reputation: 3704

code not merge and commit through source tree

I am new to git and source tree. I have problem in

I am trying to commit my changes on stash I commit it through source tree but not able to push it got this error

! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'http://[email protected]:7990/scm/ddn/mytrainer.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

I have tried to pull the changes which are there on the pull tab but it is showing error

error: Your local changes to the following files would be overwritten by merge: grails-app/conf/BuildConfig.groovy
Please, commit your changes or stash them before you can merge. Aborting

How do I commit the changes without affecting the commits done by other team member through source tree.

Thanks

Upvotes: 0

Views: 1089

Answers (1)

Akshay Kumar
Akshay Kumar

Reputation: 160

As far I understand, this should work for you.
1) Stash the changes as explained in here.
2) Pull from master branch
3) Pop the stashed changes as explained in the source tree link.

In general,
Stashing and committing are two different things,

Stash - temporarily store the changes you are working on.

Command line:

git stash

Sourcetree, Stash the changes you made, read [this]

Commit - is used to make you changes permanent.

git commit

before you commit, you have to stage the changes, this can be done by

git add * to add all file
git add filename

Hope this helps.

Upvotes: 3

Related Questions