Discussion in 'Tech & Programming' started by vorsybl, Apr 15, 2018.
I looked everywhere on google and cant figure it out
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
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?
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
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.
Separate names with a comma.