Difference between revisions of "Git"

From wiki
Jump to navigation Jump to search
(Created page with "Using the [https://bitbucket.org/ Bitbucket] code repository with git. ==Starting== Install the git tools: <code>apt-get install git</code> Initialize your user with: :a nam...")
 
Line 1: Line 1:
 
Using the [https://bitbucket.org/ Bitbucket] code repository with git.
 
Using the [https://bitbucket.org/ Bitbucket] code repository with git.
  
==Starting==
+
==Using Git==
 +
Here is a basic overview of how Git works:
 +
 
 +
# Create a "repository" (project) with a git hosting tool (like Bitbucket)
 +
# Copy (or clone) the repository to your local machine
 +
::<code>git clone <repoURL></code>
 +
# Add a file to your local repo and "commit" (save) the changes
 +
::<code>git add <filenname></code>
 +
# "Push" your changes to your master branch
 +
::<code>git push</code>
 +
# Make a change to your file with a git hosting tool and commit
 +
# "Pull" the changes to your local machine
 +
::<code>git pull</code>
 +
# Create a "branch" (version), make a change, commit the change
 +
# Open a "pull request" (propose changes to the master branch)
 +
# "Merge" your branch to the master branch
 +
 
 +
;<code>git config --local -l</code>
 +
:List your configuration for this repository (in the current directory).
 +
 
 +
==Local setup==
 
Install the git tools: <code>apt-get install git</code>
 
Install the git tools: <code>apt-get install git</code>
  
Line 11: Line 31:
  
 
You homedir now has a .gitconfig files with this information
 
You homedir now has a .gitconfig files with this information
 +
;<code>git config -l</code>
 +
:List your configuration on user level

Revision as of 16:14, 10 May 2018

Using the Bitbucket code repository with git.

Using Git

Here is a basic overview of how Git works:

  1. Create a "repository" (project) with a git hosting tool (like Bitbucket)
  2. Copy (or clone) the repository to your local machine
git clone <repoURL>
  1. Add a file to your local repo and "commit" (save) the changes
git add <filenname>
  1. "Push" your changes to your master branch
git push
  1. Make a change to your file with a git hosting tool and commit
  2. "Pull" the changes to your local machine
git pull
  1. Create a "branch" (version), make a change, commit the change
  2. Open a "pull request" (propose changes to the master branch)
  3. "Merge" your branch to the master branch
git config --local -l
List your configuration for this repository (in the current directory).

Local setup

Install the git tools: apt-get install git

Initialize your user with:

a name: git config --global user.name "Your Name"
and email: git config --global user.email "user@domain.tld"

Set line endings correctly: git config --global core.autocrlf input

You homedir now has a .gitconfig files with this information

git config -l
List your configuration on user level