Hack Forums
[Tutorial] Manage your code with git - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5)
+---- Thread: [Tutorial] Manage your code with git (/showthread.php?tid=4914243)



Manage your code with git - ๖ꜦȳpƎƦ SƟƱƿ - Jul 20, 2015

MANAGE YOUR CODE WITH GIT AND GITHUB(linux)


In this tutorial you will learn how to manage version control with git.

First create a git directory to keep thing clean.

Code
mkdir ~/git
then we go to our directory:
Code
cd ~/git

once you are in your directory do:
Code
sudo apt-get install git
This will install git or update it if you already installed it.
Now go to GitHub and create an account.

Once you have your account, create your repository.

In your repository copy your HTTPS clone url.

go back to your terminal and type :
Code
git config --global user.name "My Name"
and
Code
git config --global user.email "[email protected]"
Time to clone! type:
Code
git clone "yourremoteHTTPSadress"

And a folder with the name of your repository should be created!

goto your folder with "cd". if your files are in view only type in the terminal:

Code
chmod 7 "yourfile"

Then you need to initialize your remote:
Code
git remote set-url origin "yourhttpscloneadress"

now add the files you want git to track changes.
Code
git add "file"

Now edit the file you want.
Once edited go to you terminal and type:
Code
git commit

and then
Code
git push

you should be prompted for an username and a password, Use your github credentials.

Done!

this is the end of this tutorial. if you want to know more about git PM me. ✌




* - Sakuto - Jul 21, 2015

That's very light for a tutorial on git... You should at least show hw to connect through SSH and use keys to avoid typing password each time.


* - ๖ꜦȳpƎƦ SƟƱƿ - Jul 25, 2015

(Jul 21, 2015 10:34 AM)Sakuto Wrote:  That's very light for a tutorial on git... You should at least show hw to connect through SSH and use keys to avoid typing password each time.

SSH dont really works for me so...


* - Elin - Jul 25, 2015

This is a nice tutorial for newbies.
I do not like git for some reasons though.


* - ๖ꜦȳpƎƦ SƟƱƿ - Jul 31, 2015

(Jul 25, 2015 10:05 PM)Elin Wrote:  This is a nice tutorial for newbies.
I do not like git for some reasons though.

Whow soo long thread i dont know if gravedug or no soo: thank you for the feedback!