Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does git pull . do?

Tags:

git

git-pull

When I run it on my git repo this is what I get.

git pull .
From .
 * branch            HEAD       -> FETCH_HEAD
Current branch rel_20121207 is up to date.

But when I run just git pull it actually updates from the remote.

I would like to know what exactly happened when I ran git pull .

like image 589
Sujay Avatar asked Jan 08 '13 08:01

Sujay


People also ask

What is git pull exactly?

Git pull is a command that allows you to fetch from and integrate with another repository or local branch. From this definition, you can see that a Git pull is actually a Git fetch followed by an additional action(s)—typically a Git merge.

Is it safe to git pull?

git pull isn't bad if used properly. If you are the only owner and user of the git repository, it is okay to use it. The pull command is actually a combination of two commands, git fetch and git merge . This is okay if your local branch is in sync with the remote branch.

What is pull used for?

The term pull is used to receive data from GitHub. It fetches and merges changes from the remote server to your working directory. The git pull command is used to pull a repository.

What is difference between pull and fetch in git?

Git Fetch is the command that tells the local repository that there are changes available in the remote repository without bringing the changes into the local repository. Git Pull on the other hand brings the copy of the remote directory changes into the local repository.


1 Answers

Ha, this one's fun. git pull takes a remote name, or a file spec. You're giving it a file spec ('.' means the current directory), so it's treating your current repo like a remote, and throwing your current HEAD into FETCH_HEAD. You're pulling your repo into itself; essentially it's doing nothing.

like image 198
ellotheth Avatar answered Nov 24 '22 09:11

ellotheth