Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7656167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:41:55+00:00 2026-05-31T12:41:55+00:00

When updating my git repository after changes, I normally issue the following commands: git

  • 0

When updating my git repository after changes, I normally issue the following commands:

git add .
git commit -m 'changes'

If I delete files during the session and run git add ., will this add these files to the repository again?

What’s the best approach for covering everything during a commit?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:41:57+00:00Added an answer on May 31, 2026 at 12:41 pm

    Best practice would probably be:

    • use a .gitignore file
    • use the staging area
    • review your changes as you commit

    If you are only editing files for example:

    git commit -va
    

    That will add all changed files and open your configured editor so you can write the commit message. Under the commit message are the changes you are going to commit in diff format.

    If you have more changes in your working copy, and only want to commit some of them use the staging area:

    git add this
    git rm that
    
    git status
    # On branch foo
    # Changes to be committed:
    #   (use "git reset HEAD <file>..." to unstage)
    #
    # deleted:  that
    # modified: this
    #
    # Changes not staged for commit:
    # ....
    
    git commit -v
    

    Again, using a verbose commit (show diff) and no message (so the editor opens) allows you easy control without missing anything.

    If you close the editor without typing a commit message, the commit will be aborted. Quite often just skimming the diff – or even just the list of files to be commited – you’ll notice something missing or wrong and want to correct that.

    using git add . will add all files that you aren’t explicitly ignoring with your .gitignore files. That’s probably not the best way to commit by default, no doubt you’ve already committed files you didn’t really want in your repository that way.

    If you git rm a file, recreate the file, are not .gitignoreing the file and then run git add . – you will just add the file back to the staged changes to be made in your next commit (which will then either be an edit to the file you originally deleted, or no action because the contents haven’t changed).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to refresh a git repository after updating the gitignore file? I
I have been experiencing the following problem when updating a local repository with PULL
Error message: fatal: git checkout: updating paths is incompatible with switching branches/forcing How to
I understand the default Git behaviour of updating the modification time every time it
Updating an old ASP/Access site for a client - I need SQL to add
After updating or creating a record I use url helper to redirect to the
After updating to php 5.3 one of our systems has developed an interesting bug.
I've been doing a workflow of making a git repository on a remote central
I have an issue: while git push ing I've got an error: Fetching remote
I have a git svn repository. git svn clone http://myrepo/ myrepo I dont want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.