1. Hello and welcome to the brand new home for PlayDota!
    Please read through our Welcome thread to see what's new!
    Dismiss Notice

How do i push my python code file from emacs in linux, to github, to my friend on github?

Discussion in 'Tech & Programming' started by vorsybl, Apr 15, 2018.

  1. vorsybl

    vorsybl Member

    Mar 17, 2015
    I looked everywhere on google and cant figure it out
  2. RNGeezus

    RNGeezus Member

    Nov 18, 2014
    learn to use google, it's your friend. ask it questions and you get answers.

    Read this: http://rogerdudler.github.io/git-guide/

    IDK what emacs is, but from the terminal, you type in commands depending on what you want to do and you update it. once you update code on github your friend can see it if he refreshes his page.

    Initialize Git: git init

    Get everything ready to commit: git add .

    Get custom file ready to commit: git add index.html

    Commit changes: git commit -m "Message"

    Add and commit in one step: git commit -am "Message"

    Remove files from Git: git rm index.html

    Update all changes: git add -u

    Remove file but do not track anymore: git rm --cached index.html

    Move or rename files: git mv index.html dir/index_new.html

    Undo modifications (restore files from latest commited version): git checkout -- index.html

    Restore file from a custom commit (in current branch): git checkout 6eb715d -- index.html
  3. vorsybl

    vorsybl Member

    Mar 17, 2015
    Sup bro thanks! Got it to work. Yeah i didn't realize git is a tool and it's used through terminal. EMACS is just a text editor in linux for writing code. Successfully pushed the code onto my github repo, and added my friend as a collaborator.

    Say i have 20 python files in one folder, the host directory im in. Is there a way to add all of them at once instead of each one manually?
    RNGeezus likes this.
  4. Eli_Green

    Eli_Green Member

    Oct 29, 2013
    Honestly it's not hard to search for; asking people here to do stuff like this for you is detrimental to your learning.

    Just my 2c
  5. Blarrg

    Blarrg Member

    Jun 12, 2009
    Use the wildcard (*) symbol to select all files following a pattern.

    git add *

    Adds all files in directory to the git commit

    git add *.py

    Adds all files with .py extension to the git commit

    git add thing*

    Adds all files that start with "thing" to the git commit

    The wildcard (*) is a pretty globally recognized operator that will probably work on any command line (ie "rm *" removes all files in directory).

    Also, Google is your friend when coding. You can find lots of answers to your questions pretty easily just by Googling. StackOverflow is great, too.
    Last edited: Apr 18, 2018