How to update files?

2 views
Skip to first unread message

john...@gmail.com

unread,
Sep 6, 2016, 5:21:50 PM9/6/16
to GitX
Hi

Noob seeks help. 

I have already committed some files to git. 


I'm ready to upload the new version of a bunch of files. My working-directory, where i do my development, is not my git directory. I think what i should do is:

  • delete all files in the "Unstaged Changes" area:


  • In Finder, copy all the new files into the git folder. 
  • In GitX, in Unstaged pane, select all the files, drag all the files to the "staged changes" pane, type a comment in the 'commit message' pane, and click the "Commit" button. 
Is that correct?

thx!

Etienne Samson

unread,
Sep 6, 2016, 6:25:50 PM9/6/16
to gi...@googlegroups.com

> Le 6 sept. 2016 à 23:21, john...@gmail.com a écrit :
>
> Hi
>
> Noob seeks help.
>
> I have already committed some files to git.
>
>
> I'm ready to upload the new version of a bunch of files.

Just a clarification: In git, if you're not using push or fetch (or pull), you're not really uploading anything. And the description of your problem sounds like you're trying to commit.

> My working-directory, where i do my development, is not my git directory.

Sorry, that's not clear to me.

Do you mean that your workflow is akin to:
- make some changes For Development™
- manually copy files inside the git working directory
- attempt to save the current state via git ?

> I think what i should do is:
>
> • delete all files in the "Unstaged Changes" area:

Unless you have a backup somewhere that's not really recommended ;-). If you do that, git will only be able to restore to the last known state of the file, and your work will be lost.

GitX shows colors depending on the status of the file, so red means "deleted" (git knows this file, but it doesn't exist anymore), green is "changed", and the blank ones are "untracked" (git doesn't know them yet).

> • In Finder, copy all the new files into the git folder.
> • In GitX, in Unstaged pane, select all the files, drag all the files to the "staged changes" pane, type a comment in the 'commit message' pane, and click the "Commit" button.
> Is that correct?

I can't really say without your workflow being clearer. In the normal case, you should have a git repository *inside* your working-directory (eg. the hidden ".git" folder), so the copying is unneeded.

Then it's just a matter of "moving" files from Unstaged to Staged (via dragging, double-click, or the Stage/Unstage buttons in the Diff view if you want to get fancy), enter a commit message and Commit. git will register those files and keep them safe.

Regards,
Etienne Samson
--
samson....@gmail.com

Reply all
Reply to author
Forward
0 new messages