How to insall git and upload fies for version control
version control by git hub , or updating you codes into git hub
- Here only how to update i.e - how to push is explained
- This assumes you have a git hub or bit bucket account
- author email rinkanrohitjena@live.com
How to install git in your linux system is instructed here
>>if you have not installed the git on your computer type the following commands
apt-get install git
this will install git on your pc
now visit to
and sign up
in your computer open the terminal and type
git config --global user.name "john doe"
replace the user name with your user name
git config --global user.email example@example.com
replace the email address with your email id
and type the following command as it it
git config --global push.default matching
git config --global alias.co checkout
after you are finished with all these steps follow the steps below
Here is steps to starts after installing
>> open up your browser and go to or bit bucket and sign up
>> after that go to settings and create a new Repositary
under Repositary menu
dont close the open page as it needs has instructions
you need to addone ssh key in order to secure your connection
>> for adding the key go to setting and click on add a key
at the same time move to your project folder by
cd /root/Documents /examplefolder
you need the ssh key so type
cat /root/.ssh/id_rsa.pub
if you get some error there follow the following steps as there is now key found on your linux system
try the code cd %userproile%/.ssh
this should show you some o/p , in case it doesn't show you try folowing
open the terminal and type ssh-keygen -t rsa -C "rinkanrohitjena@live.com"
The above line will generate the key
you need to press enter 2 -3 times , pass the passphrase if you want but default will also work with the git
To check and to change the directory type cd ~/.ssh
This will take you to /root/.shh
folder
now concatenate cat
the id_rsa.pub
and copy the out put and paste it in the key in
how to work with the git Repositary
you need to intialise git in your directory so type
git init
from the Repositary page copy the code which looks like follows
git remote add origin git@github.com:rinkanrohitjena/rstudiocode.git
Then to add all files to git you need to type
git add .
now git wants you to make chages with a comment for that you need to type the command below
git commit -m "first commit"
the first commit is your comment about the version ,you can type too version1.o
now you need to upload the files into git hub
the command for first time upload is follows
git push -u origin master
this will ulodad your code to the git hub for the first time
again when you made any changes to codes and you want to update you need to upload
git push
this will upload your code with out hassel
Comments
Post a Comment