-1

I wonder what is the best way to perform a commit when there are many changes in the repository

I always work with svn from the ide. I am learning to use git from console and I would like to do the following before a commit:

  • see all files that are modified on the server
  • I want to manually merge the files I want
  • upload the changes to the repository.

I have been researching and found the following commands:

for commit my changes:

git add -A
git commit -m "..."

to download changes:

git fetch 

I need see the files that have changed, and then merge them manually

I know there

git rebase 

but this is like a pull, I want something less invasive.

Sorry for my English

bahrep
  • 29,961
  • 12
  • 103
  • 150
user60108
  • 3,270
  • 2
  • 27
  • 43

1 Answers1

2

This is the sequence I use:

See which files changed with

git status

Review the changes made

git diff

Choose which files to commit with

git add 'filename'

Commit

git commit -m 'Some comment'

Push the changes up to the remote repository

git push origin 'repo'

For large or complex merging, I use NetBeans or Meld

user2182349
  • 9,569
  • 3
  • 29
  • 41
  • git diff show the differences with files that are in the repository? How to merge the files manually? – user60108 Jun 15 '16 at 02:04
  • I understand that using git mergetool -t meld can resolve conflicts, but I want to make a merge manually because not necessarily have to lead to conflict. – user60108 Jun 15 '16 at 02:09
  • You can use the diff to show you which lines to change and use an editor on the affected file. – user2182349 Jun 15 '16 at 02:20
  • Thank you, But this compares stage with working directory? I want to compare with the repository and I want to do manually merging – user60108 Jun 15 '16 at 02:26