Git configure on ubuntu
To configure GIT server on your ubuntu machine, Please follow following steps:
Configure GIT Server
1. Make sure git is installed on your ubuntu machine. We can insure about this by following command
> git --version
it should display the GIT version.
2. We need to create user for GIT. Perform following steps to create user :
> sudo adduser username
it will ask for password, Enter your new password for GIT and enter the correct information.
> su username
> mkdir projectFolder
> cd projectFolder
> mkdir project.git
> cd project.git
> git --bare init
Now your empty repository has been created. You can push files to this repo.
Push files to GIT Server
We can push files to GIT server from remote machines. Perform following steps to push files from a linux machine.
1. Create a folder, in which you want to clone your git project.
> mkdir myGitProject
> cd myGitProject
2. We will clone our git project here.
> git clone user@gitmachine:/git/project/path
3. It will clone project here.
4. Copy your files to same folder, which you want to check in.
5. Add files to git stage
> git add fileName
6. Insert commit to your files check in.
> git commit
7. Push files to git
> git push origin master
Configure GIT Server
1. Make sure git is installed on your ubuntu machine. We can insure about this by following command
> git --version
it should display the GIT version.
2. We need to create user for GIT. Perform following steps to create user :
> sudo adduser username
it will ask for password, Enter your new password for GIT and enter the correct information.
> su username
> mkdir projectFolder
> cd projectFolder
> mkdir project.git
> cd project.git
> git --bare init
Now your empty repository has been created. You can push files to this repo.
Push files to GIT Server
We can push files to GIT server from remote machines. Perform following steps to push files from a linux machine.
1. Create a folder, in which you want to clone your git project.
> mkdir myGitProject
> cd myGitProject
2. We will clone our git project here.
> git clone user@gitmachine:/git/project/path
3. It will clone project here.
4. Copy your files to same folder, which you want to check in.
5. Add files to git stage
> git add fileName
6. Insert commit to your files check in.
> git commit
7. Push files to git
> git push origin master
Comments
Post a Comment