Adding my files to Github

Asked

Viewed 1,531 times

3

When I started my project, I put all my files on Github correctly, but with the modifications I made I forgot to update the files in git.

Now I need to pass all the files to Github, as I’m starting in git I have no idea how to update them

  • Do you want to do it via console or have some program to manage git?

  • It would be good for you to explain better what you want to do and how you want to do it. If you weren’t updating Reset, there’s nothing important there right now, right? It wouldn’t be better to just create a new repository and uproot all the files for it?

4 answers

6


First if you have the Git installed, via command line you need to open the Git Bash navigate to your local repository directory:

cd c:/seuCaminhoDoRepositorio

Then you can optionally check the status of your repository:

git status

To add all files you want to commit in Stage:

git add .

Once this is done, run the command below to commit a message:

git commit -m "Sua mensagem"

Finally run the push command to send your changes

git push 

or

git push origin master
  • git add . will not add new files. Or will?

  • git add . adds the files to your local git header. Once you’ve added them to your local git, to send it to remote git, you need to give a git commit -m "Descrição das alterações" and then a git push origin master.

  • @LINQ Yes (https://answall.com/questions/142726/addir-todas-as-%C3%Baltimas-mudan%C3%A7as-ao-commit-no-git/142763#142763)

  • then just give the commands above ?

  • @luismatheus Yes, you can execute the response commands.

  • @Renan I just did a test and it doesn’t just add with deleted ones. See: https://stackoverflow.com/a/572660/4190610

  • apparently sending the files

  • It worked, the files were uploaded, but the strange thing is that my Bower_components folder has not been uploaded

  • This Bower_components folder of yours had files?

  • yes are all my bootstrap plugins

Show 5 more comments

2

Git is a version control tool created by Linus Torvalds to aid in the creation of the Linux kernel. The tool has its own culture, language-specific terms and concepts. Research is highly recommended for productivity in your applications. However it is quite common that developers need to use the tool, even before mastering all concepts (commit, diff, pull request, status, etc.). For these cases, it is recommended a minimum script to use the tool blindly, without harming learning. It is not the intention of this post to 'teach a lesson' in git, since broad themes do not agree with the philosophy of this community. Follows recommendation of a blind script model for git beginners:

1 - Clone your repository (git clone) - With the command git clone www.seurepositorio.com you will have access to your entire project, including data files that will send new information to the original repository. Make changes to this repository (editing files, dragging folders, etc).

2 - Suggest adding new files (git add) - The git tool assumes that its application is being built by multiple developers (for which it was created), although it is very useful for solo development. With the command git add * you suggest adding the new files to the project. You can also choose to git add nomeDoArquivo.Ext for adding a specific file.

3 - Commit (git commit) - After all the changes made, it’s time to commitar your project. It is the act of sending a proposal with all modifications to the administrators LOCAL (on your own network or machine) of the project (in your case yourself). Use the command git commit -m "Anote aqui as alterações como histórico".

4 - Upload your project (git push) - After all changes made to the local repository, it’s time to give a push your project. It is the act of sending a proposal with all modifications to the administrators REMOTE (the original repository) of the project (in your case yourself). Use the command git push origin".

Completion: - Git is a powerful tool, with several commands that are part of the version control routine. For the specific case of this topic, it is recommended to familiarize yourself with these four steps. Although there are other commands like git push (updates the repository) and git status (current situation of watched files), is not recommended for the beginner who still works with solo developments, interrupt your projects to delve into git. The need to learn new git commands will come naturally. Although you have a lot of texts on the Internet about the tool, you will hardly find one with didactic quality. I can only quote two reasonable ones such as the tableless and the guide practical from git done by Roger Dudler .

2

I find it excellent to learn the basic commands at least of GIT, After all, even anyone who uses a git client with a graphical interface will need some command at some point, but as an additional response I would like to point out some tools that are intended to facilitate the use of the Git, an example is the Github Desktop which is has versions to Windows and Mac

github desktop

Another way to manage your files is by using the web interface, you can upload:

upload

Or simply drag an entire folder:

drag drop

Alternatives

Apart from the Github Desktop and the Web interface also exist programs like:

  • Sourcetree which supports not only Bitbucket, but any Git repository and has versions for Windows and Mac
  • Gitkraken has versions for Windows, Mac and Linux

0

First you have to put your new files in the header of your local git with the following command:
git add .

Next you have to create a version describing the new changes:
git commit -m "Descreva as alterações nesse limite de aspas"

Once done, you can send your version to your remote git with the following command:
git push origin master

  • 1

    That’s right @Ikaro Pinheiro, but I already answered earlier giving more details, it was almost a Ctrl+c and Ctrl+v its answer rs

Browser other questions tagged

You are not signed in. Login or sign up in order to post.