Reputation: 3601
I have copied my Android Studio project's folder to my local GitHub directory and I'm trying to push it using git add .
. However, it shows (modified content, untracked content)
behind the directory's name, and the directory is not added.
I've tried removing the .gitignore
files and adding the directory from the git bash in the folder itself, but that does not work. What could I do?
Upvotes: 0
Views: 956
Reputation: 9381
Normal workflow for a new project to commit everything except for what is excluded with the .gitignore
:
git init
create local repo
git add .
add every file not excluded with gitignore
git commit -m "init"
create a commit with a message -m
git remote add origin <remote repository URL>
add the remote, for example github
git push origin master
push to the newly added remote
From then on:
make changes
git stash
stashes your changes for you on a sort of Clipboard (copy)
git checkout -b <new branch name>
git stash apply
paste the changes to this new branch
git add -p
and select the changes you want to commit in the next step
git commit -m "bla
add a message to commit
git push origin <branch name from before>
Upvotes: 1
Reputation: 3671
Your command line shell is likely just showing that you did not yet do git commit
(usually performed after git add
).
There's also the possibility that you have files that were deleted, in which case git add -u .
would be helpful, too (in addition to the regular git add
). And... git add -a
might be a nice option, too. You'd still want to commit after adding/staging the modifications.
Upvotes: 0