The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

SourceTree - How to Merge/Commit after Pull

S Green
September 12, 2015

Recently I did a Pull to get the latest from the remote. Immediately after that, my Working Copy changed to 23 from 7 (under File Status on the left panel). Presumably, the difference is the new files pulled from the remote that are newer than my local copies. The bottom status bar says: master Merge: 17 modified 6 missing. (I know that a dev deleted files which explains the 6 missing).

I want to update my local dev environment with the latest files, but am unclear how to do that and get my Working Copy back to the number that reflects only the files that I have changed locally.

git status from command line says “On branch master. All conflicts fixed but you are still merging.
Use “git commit” to conclude merge. In addition, there is a list of files (in red) that are “Changes not staged for commit. (I have not touched those files).
Use ‘git add/rm’ to update what will be committed.
Use ‘git checkout’ to discard changes in working directory.

Question: what is the fastest way to just update my local files and get “Working Copy” to 0?
Do I really need to do a “git commit” AND “git add” AND “git checkout”?


I’m just nervous about potentially changing anything on the remote or getting further out of synch.

Thanks in advance.

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
September 14, 2015

Correct. "Commit" is a local operation. You must "Push" to modify remotes.

0 votes
S Green
September 14, 2015

Thanks Seth. If we assume that I did not have uncommitted changes in my repo, and all I need to do is commit all the changes I've pulled from remote repo, is it correct that I can hit the top "commit" button? Just confirming that that only impacts my local repo (because I don't want to change remote at this point). Cheers

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
September 14, 2015

This sounds like an unusual situation to me. In my experience Git won't allow me to pull if I have any uncomitted changes in my repo. Are you confident you had local changes (that weren't committed)?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events