Python Forum

Full Version: Forcing a github push after major changes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I cloned a repository (my own) to may computer.
I then created all of the parts required for a package that I could add to PyPi
including renaming some python modules.

Now, with all the changes in place, I want to force  a push back to github.
I tried the following (from the copy on my computer):
git push https://github.com/Larz60p/CaliforniaPublicSalaries --force
and received the following message:
Output:
Everything up-to-date
I am a novice at this, and am thinking my command might need more information

Also, I'd like to create a stand alone executable (still keeping the source) and like that to be part of the distribution.
Hi, have you done "git commit" first, before doing "git push"?
Or maybe check that you are on the right branch (some "development" branch, or master).
Got:
Output:
λ git commit On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit:        deleted:    LICENSE        deleted:    README.md        deleted:    __init__.py        deleted:    screenshot.png        deleted:    src/CaCompGui.py        deleted:    src/UpdateCatalog.py        deleted:    src/__init__.py Untracked files:        build/        dist/        pip-selfcheck.json        pyvenv.cfg        setup.cfg        setup.py no changes added to commit
I don't like the deleted list either. I need to take another look at this before I proceed.
It seems that you have your files untracked, so you need to add files first, after that you can commit them into the repository.  Try 
Output:
git add . git commit
in your directory before pushing.

EDIT: I have overlooked your other questions. I am not a big git expert, but from my understanding if you move or rename files/directories, from git's point of view they disappeared (so git status lists them as deleted), while renamed/moved files are untracked by git and you need to add your changes with git add . . After that you can commit and push your changes.

Git has no problems with binary files, actually it doesnt care at all - even for text files git just computes sha-1 for files and if it changes, git saves entire file (in his internal compressed format). So you can put your binary into the repository and add and commit.
Thanks. I have avoided packaging files in the past, only because it seemed to be a bother
I now have 9 repositories, each of which should be packaged.
Tutorial information for this subject tends to be sparse, or at least I don't seem to be finding
the one that works for me.
I thought I saw (or perhaps I wished I saw) a blurb about changing basic directory structure
and being able to force it into github.
I'll play with add today.
Quote:Changes not staged for commit:
       deleted:    LICENSE
       deleted:    README.md
       deleted:    __init__.py
       deleted:    screenshot.png
       deleted:    src/CaCompGui.py
       deleted:    src/UpdateCatalog.py
       deleted:    src/__init__.py
These are files that you removed on your local repo, but they still exist on the github repo as it hasnt been updated yet.

Quote:Untracked files:
       build/
       dist/
       pip-selfcheck.json
       pyvenv.cfg
       setup.cfg
       setup.py
These are files on your local repo, that are not on the github repo.

The following will update your repo assuming you are using master and not a branch
git add .
git commit -m "I updated blah blah"
git push origin master
After this your local and github repo should be in sync.


EDIT:
Why do you have the URL in the command? Did you ever connect the directory with the github repo? Should be something like... git remote add origin https://github.com/Larz60p/CaliforniaPublicSalaries.git

I made a tut with the basics of initializing and adding files to a repo. Not much after that, was just trying to get people to use repos instead of posting multiple files on the forum  Smile. But it includes what you are doing here. 
Thanks metulburr.
Will let you know how I make out.
Also, I will make an executable for windows, should that be part of the package or not?
Some people will complain. They want you to add them in releases or add a script to generate an exe, etc. But there is nothing stopping you from adding them in alongside your code. I in-fact prefer to add them with my code as it makes it easier for people in my opinion.

an example:
https://github.com/justinmeister/Mario-L...50b18dd6b8
(Mar-30-2017, 11:54 AM)Larz60+ Wrote: [ -> ]Also, I will make an executable for windows, should that be part of the package or not?
It depend on the prospect an the users it targeting.
Some project it make no sense to make a "exe" for,an for other prospect it can make a lot of sense.
I have "exe" releases for all version of my Norwegian Tv project.
For Linux versions i have Read_me how to install.

I have a lot Windows user that do not know what Python is(they guess a Snake) or that OS has command line.
They would never had used my project if i had to a Read_me for Windows like eg(install Python, FFmpeg, WxPython and many 3-party modules).
If you're on Windows/Mac, I highly recommend Github Desktop. It watches for new files, adds them automatically (with checkboxes so you can avoid committing them if you don't want), and it has a diff panel so you can view all changes before committing them. Instead of push/pull, there's a single "sync" button in the top right... so you can continue to work locally if that's how you prefer.
Pages: 1 2