Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the unstaged changes in github?

Tags:

github

I just changed the README file and want to sync it in github, but it always tells me "You cannot sync with unstaged changes". Could someone tell me what it is and how should I fix this?

like image 496
chaonextdoor Avatar asked Jun 08 '12 18:06

chaonextdoor


People also ask

What happens to unstaged changes after commit?

Unstage Commits HardThe staging index is reset to match the specified commit. Working Directory is reset to match specified commit. Any pending changes in the Working Directory and Staging Index are lost.

What is unstaged?

unstaged (not comparable) (theater) Not formally staged; not presented to an audience on a stage.

What are staged changes to commit?

When you're ready to save a copy of the current state of the project, you stage changes with git add . After you're happy with the staged snapshot, you commit it to the project history with git commit . The git reset command is used to undo a commit or staged snapshot.

Does git commit unstaged changes?

TL;DR: When one file has staged and unstaged changes, a commit will commit both versions, with the most recent changes to the file.


1 Answers

Look at learn.github:

staging

You need to:

  • add your file to the index (git add),
  • and commit it (git commit -m "your modification comment"),
  • before pushing it (git push).
    See also "working with remotes")

So "unstaged changes" aren't linked to GitHub, but are local modifications on your local repo, which you haven't yet added to the index ("staged"), for a future commit.

like image 66
VonC Avatar answered Oct 13 '22 00:10

VonC