Difference between revisions of "GIT client"

 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Linux]]
 
[[Category:Linux]]
 
[[Category:Development]]
 
[[Category:Development]]
 +
 +
  
 
=References=
 
=References=
  
 +
Concepts, tutorials and how-to:
 +
* Short introduction: [http://rogerdudler.github.io/git-guide/ Git short guide]
 +
* Excellent "Git complete guide" (with videos): [https://docs.microsoft.com/en-us/azure/devops/repos/git/pulling?view=vsts&tabs=visual-studio Visual Studio GIT howTo]
 +
* Complete and excellent introduction, all in 1 blog post: [https://itnext.io/become-a-git-pro-in-just-one-blog-a-thorough-guide-to-git-architecture-and-command-line-interface-93fbe9bdb395 Become a Git pro in just one blog: a thorough guide to git architecture and command line interface]
 +
 +
Official documentation:
 
* Official website: http://git-scm.com
 
* Official website: http://git-scm.com
 
* Help page: http://git-scm.com/book/en/  
 
* Help page: http://git-scm.com/book/en/  
 
* GitHub wiki page: https://help.github.com/articles/set-up-git/
 
* GitHub wiki page: https://help.github.com/articles/set-up-git/
 +
  
  
 
=Installation=
 
=Installation=
  
<syntaxhighlight lang="bash">
+
See [[GIT setup|Git setup]]
apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
 
apt-get install git git-doc git-gui
 
</syntaxhighlight>
 
 
 
 
 
If you want to use GIT as your local SVN client:
 
<syntaxhighlight lang="bash">
 
apt-get install git-svn
 
</syntaxhighlight>
 
 
 
 
 
If you want to browse the GIT repository in a local browser:
 
<syntaxhighlight lang="bash">
 
apt-get install gitweb
 
</syntaxhighlight>
 
 
 
 
 
 
 
=Configuration=
 
 
 
Run the following commands a '''standard user''', not root!
 
 
 
<syntaxhighlight lang="bash">
 
git config --global user.name "guillaume.diaz"
 
git config --global user.email johndoe@example.com
 
git config --global core.editor vim
 
</syntaxhighlight>
 
 
 
 
 
 
 
=Register SSH key=
 
 
 
If you'd like to register a SSH key to use with GIT, see the excellent GitHub documentation: https://help.github.com/articles/generating-ssh-keys/
 
 
 
 
 
 
 
=Get project files=
 
 
 
Run the following commands a '''standard user''', not root!
 
 
 
 
 
* Clone an existing project
 
<syntaxhighlight lang="bash">
 
git clone [url] [targetFolder]
 
</syntaxhighlight>
 
 
 
Note that you can use HTTPS, SSH or SVN URLs.
 
 
 
 
 
 
 
* Perform operation using Git GUI
 
<syntaxhighlight lang="bash">
 
cd [my GIT repo]
 
git gui
 
</syntaxhighlight>
 
 
 
 
 
* Check files status
 
<syntaxhighlight lang="bash">
 
git status
 
</syntaxhighlight>
 
 
 
 
 
* Add file
 
<syntaxhighlight lang="bash">
 
git add [file]
 
</syntaxhighlight>
 
 
 
 
 
* Commit
 
<syntaxhighlight lang="bash">
 
git commit -m "my comment"
 
</syntaxhighlight>
 
 
 
 
 
 
 
=Ignore files in GIT=
 
 
 
Create a file called .gitignore to the root of your GIT repo.
 
 
 
<syntaxhighlight lang="bash">
 
cd [my GIT repo]
 
vim .gitignore
 
</syntaxhighlight>
 
 
 
 
 
Insert the following code:
 
 
 
<syntaxhighlight lang="bash">
 
## generic files to ignore
 
*~
 
*.lock
 
*.DS_Store
 
*.swp
 
*.out
 
*.tmp
 
*.temp
 
build/
 
 
 
#java specific
 
*.class
 
target/
 
 
 
#maven
 
pom.xml.tag
 
pom.xml.releaseBackup
 
pom.xml.versionsBackup
 
pom.xml.next
 
release.properties
 
 
 
#netbeans ignore personal stuff
 
nbproject/private/
 
  
#eclipse specifics
 
settings/
 
.project
 
.classpath
 
.checkstyle
 
</syntaxhighlight>
 
  
 +
=Usage=
  
You can find more example on https://github.com/github/gitignore
+
See
 +
* [[GIT client (basic)| GIT client (basic usage)]]
 +
* [[GIT client (EP)|GIT client European Parliament]]

Latest revision as of 07:52, 19 November 2018



References

Concepts, tutorials and how-to:

Official documentation:


Installation

See Git setup


Usage

See