You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@qq575654643 GitHub Desktop doesn't support staging of files from in the application, and I'll explain how it's currently working to help illustrate why we've designed the app this way.
When you have untracked files in a repository, they will appear in the Changes list as files with the green + icon, to indicate these are new files:
To include these files in a commit, you use the checkbox next to each file. Using the example of the above screenshot, all three files will be committed.
To ensure Desktop crafts the commit you've chosen, it will go through these steps after you've filled out a commit summary (and optional description):
reset the index of the Git repository, so that changes by external tools are not accidentally included in your commit
for each file selected, either stage the whole file, or stage selected lines if the user has chosen to make a partial commit
finally, make the commit using the summary and description entered
We avoid explicit staging support in the app because we don't want users to have to learn about the index and be conscious of the state of the index when making commits.
Let me know if you have any other questions about this.
Closing this out as inactive. @qq575654643 let me know if there's any other questions you have about how Desktop works around staging files for committing.
A manual moved file appears to git status as two files, one deleted and the other added. On the other hand, if you stage both changes, git status it's shown as a rename.
There're a couple more use cases for having control via IDE of the index or stage files, I think it's very useful for advanced users, and a few IDEs like VS Code solve both uses beautifully. (e.g., When you want to ensure some changes and keep testing or fooling around with others, then revert those without fear about the staged ones)
I'll love Github desktop supporting this, maybe the same way VS Code does (perhaps without the warning when directly committing changes without staging anything). Or maybe with some checkmark on Advanced options.
reset the index of the Git repository, so that changes by external tools are not accidentally included in your commit
Seems like this could be done by just syncing the app's state with the git index whenever the app is refocused, or at intervals just to be sure.
We avoid explicit staging support in the app because we don't want users to have to learn about the index and be conscious of the state of the index when making commits.
Oh, I see. This is actually the real motivation behind these design decisions (see also #1644 (comment)): it's apparently that Github Desktop is a git client mostly for very non-technical users.
I conclude that because the git index is an extremely basic and fundamental part of git. In fact, the visualization of staged/non-staged files/lines in Github Desktop is already a complete tutorial of the git index and how it works. When a person knows how to use Github Desktop to commit files/lines, they already understand the git index pretty much fully, at least insofar as it relates to the kind of usage of git that Github Desktop already enables.
In the issue I linked to, @billygriffin stated that this design decision is not open for debate, and that's fair, since it's your creation so you get to choose what it is and becomes. But I'm convinced it's the wrong design decision, based purely on what I have read here, which he has pointed me to. So I wanted to let you know my reasoning (above), so that it can at least be reconsidered.
Because, as I said in that issue, it was very surprising and disappointing to me to find out, when I tried Github Desktop the other day, that it stages everything in memory and has nothing to do with the real git index. But I think a more relevant downside is that it prevents features like #1644 from being implemented without reinventing git features inside the app.
First off I'll admit that I suck at git and probably did something wrong (hence why I'm trying to use the desktop app), but from what I'm seeing, your post is straight up misinformation.
The green plus sign is clicked. I put a title and description for the commit. I click 'commit to main' => error that my files are untracked. And no, it's not already uploaded on my origin/main. I had just added this file 30 mins ago and I double checked my account which hasn't had any upload in 4 days.
So, what did I do? Are my files 'untracked'? How do i 'track' files in the desktop client? Can I 'drag and drop' a file in the year 2022 without pulling out my hair ? ?
a google search lead me to believe that I cannot 'add tracked files' in this desktop client, as the people suggest that I use a command in the command line.
@qq575654643 GitHub Desktop doesn't support staging of files from in the application, and I'll explain how it's currently working to help illustrate why we've designed the app this way.
When you have untracked files in a repository, they will appear in the Changes list as files with the green + icon, to indicate these are new files:
To include these files in a commit, you use the checkbox next to each file. Using the example of the above screenshot, all three files will be committed.
To ensure Desktop crafts the commit you've chosen, it will go through these steps after you've filled out a commit summary (and optional description):
reset the index of the Git repository, so that changes by external tools are not accidentally included in your commit
for each file selected, either stage the whole file, or stage selected lines if the user has chosen to make a partial commit
finally, make the commit using the summary and description entered
We avoid explicit staging support in the app because we don't want users to have to learn about the index and be conscious of the state of the index when making commits.
Let me know if you have any other questions about this.
Reacted by Nils, Evgeny Kutepov, Barnabas Nagy and Nesrovlah
Activity
shiftkey commentedon Apr 8, 2018
@qq575654643 GitHub Desktop doesn't support staging of files from in the application, and I'll explain how it's currently working to help illustrate why we've designed the app this way.
When you have untracked files in a repository, they will appear in the Changes list as files with the green + icon, to indicate these are new files:
To include these files in a commit, you use the checkbox next to each file. Using the example of the above screenshot, all three files will be committed.
To ensure Desktop crafts the commit you've chosen, it will go through these steps after you've filled out a commit summary (and optional description):
We avoid explicit staging support in the app because we don't want users to have to learn about the index and be conscious of the state of the index when making commits.
Let me know if you have any other questions about this.
shiftkey commentedon Apr 16, 2018
Closing this out as inactive. @qq575654643 let me know if there's any other questions you have about how Desktop works around staging files for committing.
nilsandrey commentedon Nov 19, 2020
A manual moved file appears to git status as two files, one deleted and the other added. On the other hand, if you stage both changes, git status it's shown as a rename.
There're a couple more use cases for having control via IDE of the index or stage files, I think it's very useful for advanced users, and a few IDEs like VS Code solve both uses beautifully. (e.g., When you want to ensure some changes and keep testing or fooling around with others, then revert those without fear about the staged ones)
I'll love Github desktop supporting this, maybe the same way VS Code does (perhaps without the warning when directly committing changes without staging anything). Or maybe with some checkmark on Advanced options.
sdegutis commentedon Mar 16, 2021
Seems like this could be done by just syncing the app's state with the git index whenever the app is refocused, or at intervals just to be sure.
Oh, I see. This is actually the real motivation behind these design decisions (see also #1644 (comment)): it's apparently that Github Desktop is a git client mostly for very non-technical users.
I conclude that because the git index is an extremely basic and fundamental part of git. In fact, the visualization of staged/non-staged files/lines in Github Desktop is already a complete tutorial of the git index and how it works. When a person knows how to use Github Desktop to commit files/lines, they already understand the git index pretty much fully, at least insofar as it relates to the kind of usage of git that Github Desktop already enables.
In the issue I linked to, @billygriffin stated that this design decision is not open for debate, and that's fair, since it's your creation so you get to choose what it is and becomes. But I'm convinced it's the wrong design decision, based purely on what I have read here, which he has pointed me to. So I wanted to let you know my reasoning (above), so that it can at least be reconsidered.
Because, as I said in that issue, it was very surprising and disappointing to me to find out, when I tried Github Desktop the other day, that it stages everything in memory and has nothing to do with the real git index. But I think a more relevant downside is that it prevents features like #1644 from being implemented without reinventing git features inside the app.
zmerson commentedon Aug 10, 2022
The green plus sign is clicked. I put a title and description for the commit. I click 'commit to main' => error that my files are untracked. And no, it's not already uploaded on my origin/main. I had just added this file 30 mins ago and I double checked my account which hasn't had any upload in 4 days.
So, what did I do? Are my files 'untracked'? How do i 'track' files in the desktop client? Can I 'drag and drop' a file in the year 2022 without pulling out my hair ? ?
a google search lead me to believe that I cannot 'add tracked files' in this desktop client, as the people suggest that I use a command in the command line.