<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GitLab &#8211; CodePills.com</title>
	<atom:link href="https://codepills.com/tag/gitlab/feed/" rel="self" type="application/rss+xml" />
	<link>https://codepills.com</link>
	<description>Helping you make a better code</description>
	<lastBuildDate>Sat, 17 Jun 2017 18:56:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>How to sync up new Git repository on GitHub or GitLab</title>
		<link>https://codepills.com/how-to-sync-up-new-git-repository-on-github-or-gitlab/</link>
					<comments>https://codepills.com/how-to-sync-up-new-git-repository-on-github-or-gitlab/#respond</comments>
		
		<dc:creator><![CDATA[Andrej Buday]]></dc:creator>
		<pubDate>Sat, 17 Jun 2017 18:56:55 +0000</pubDate>
				<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[GitLab]]></category>
		<guid isPermaLink="false">http://codekopf.com/?p=879</guid>

					<description><![CDATA[From time to time you necessary to set up new Git repository. This article is about a list of commands which are helpful for creating a new repository and syncing it with GitHub or GitLab. This article focuses only on users &#8230; <a href="https://codepills.com/how-to-sync-up-new-git-repository-on-github-or-gitlab/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>From time to time you necessary to set up new Git repository. This article is about a list of commands which are helpful for creating a new repository and syncing it with GitHub or GitLab.</p>
<p><span id="more-879"></span></p>
<p>This article focuses only on users with Mac or Linux. For creating new repository or pairing existing with GitHub account or custom GitLab on Windows, please visit official tutorial at <a href="https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/">GitHub website</a>.</p>
<p>&nbsp;</p>
<h5>Setting global git config credentials</h5>
<p>First of all, we need to be sure that we have set global config information. This is one-time configuration.</p>
<pre class="">git config --global user.name "Your Name"
git config --global user.email "your.name@email.com"
</pre>
<h5>Creating the new repository and pushing new it to GitHub or GitLab</h5>
<p>This is the short list of terminal commands for creating a new local repository and syncing the changes with GitHub or GitLab repository.</p>
<pre class="">cd folder
# Change to desired directory 
git init
# Initiate local Git repository
git remote add origin git@github.com:UserName/project.git || git@gitlab.domain.com:UserName/project.git
# Sets the new origin repository
git remote -v
# Verifies the new remote URL
git add .
# Adds all files in the local repository to stage for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'.
git commit -m "init commit"
# First local commit with message. It commits the tracked changes and prepares them to be pushed to a remote repository. 
# To remove this commit and modify the file, use 'git reset --soft HEAD~1'; and commit and add the file again.
git push -u origin master
# Pushes the changes in your local repository up to the remote repository you specified as the origin</pre>
<p>Repository SSH link can be found at GitHub or GitLab project landing page or quick setup page.</p>
<h5>Copy/Clone existing GitHub or GitLab repository to local folder</h5>
<p>This is the short list of terminal commands for cloning existing GitHub or GitLab repository to local repository.</p>
<pre class="">cd folder
# Change to desired directort
git clone git@github.com:UserName/project.git || git@gitlab.domain.com:UserName/project.git
# Clone/Copy all files</pre>
<p>Cloning the repository does not make automatically git repository. For that, we need to repeat the step (above) of initializing local Git repository and setting the origin repository on GitHub or GitLab.</p>
<h5>Security reminder</h5>
<p>Never g<code>it add</code>, <code>commit<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">, </span></code><code>push</code> sensitive information (like passwords, keys, configs, credit card numbers PINs and numbers, etc.) to your remote repository.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codepills.com/how-to-sync-up-new-git-repository-on-github-or-gitlab/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
